Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix caption alignment on images. #18818

Merged
merged 1 commit into from
Nov 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const Caption = ( { accessible, accessibilityLabel, onBlur, onChange, onFocus, i
fontSize={ 14 }
underlineColorAndroid="transparent"
textAlign={ 'center' }
tagName={ '' }
tagName={ 'p' }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got really curious about this one. how's giving a tag name fixing the alignment? 🤔

and, is it ok to have both at the same time?

rootTagsToEliminate={ [ 'p' ] }

tagName={ 'p' }

Copy link
Contributor Author

@SergioEstevao SergioEstevao Nov 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't have time to do a full investigation, but main main guess, is that when you don't define a tag, the default you get is div, and the Aztec iOS for some reason is ignoring the text alignemnt settings or defaulting the div to left alignment.

The rootTagsToEliminate is just to give the HTML back clean of <p> know that we are using the tagName of p we should no longer need it, because the component already eliminates automatically the tag refered in tagName.

Copy link
Contributor

@pinarol pinarol Nov 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't verified but suspicious that this might have caused a regression like this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't verified but suspicious that this might have caused a regression like this.

@cameronvoell has reached the same conclusion last night so, I guess that's a form of verification.

/>
</View>
);
Expand Down