-
Notifications
You must be signed in to change notification settings - Fork 3k
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: inline display for comment links #17496
Merged
Merged
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
315b6a7
fix: use block styling for parent HTML node
aswin-s 8aaa49f
fix: image styling with block parent
aswin-s c36ead4
fix: use block display only for web & desktop platforms
aswin-s d065025
fix: separate defaultViewProps into separate platform files
aswin-s 3c80630
fix: rename files
aswin-s 1d80407
add comment to explain why block display is needed
aswin-s c561d8e
fix: styling of file attachment view
aswin-s 7642625
fix: default alignment of pressables in comment renderer
aswin-s cee0034
fix: move custom style into HTML renderers
aswin-s 23ac14e
fix: pass down style props from parent
aswin-s 5a59f15
fix: use StyleUtils to destructure array type
aswin-s 594297e
fix: export ordering
aswin-s f9c99c5
reorder imports
aswin-s 0ab51e7
Merge branch 'main' into aswin_s/issue-16526
aswin-s File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/components/HTMLEngineProvider/defaultViewProps/index.native.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import styles from '../../../styles/styles'; | ||
|
||
export default { | ||
style: [styles.dFlex, styles.userSelectText], | ||
}; |
9 changes: 9 additions & 0 deletions
9
src/components/HTMLEngineProvider/defaultViewProps/index.web.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import styles from '../../../styles/styles'; | ||
|
||
export default { | ||
// For web platform default to block display. Using flex on root view will force all | ||
// child elements to be block elements even when they have display inline added to them. | ||
// This will affect elements like <a> which are inline by default. | ||
style: [styles.dBlock, styles.userSelectText], | ||
aswin-s marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,7 @@ export default { | |
dInline: { | ||
display: 'inline', | ||
}, | ||
dBlock: { | ||
display: 'block', | ||
}, | ||
}; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, @aswin-s Do you mind explaining to me why we had to remove the
styles.alignItemsStart
from Native platforms?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alignItemsStart was applied to the root renderer for both web and native platforms. While fixing it for web platform I removed it for both platforms and moved it to inner renderers which are responsible for rendering individual components. You can checkout the changes for Image and Attachment renders. This style is needed for both native and web platforms but applying it at root node has unintended effects for web.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the change was needed only for web platforms right, and switch back only for native should make no harm? I came across the problem with
dFlex
on native, as with it applied on root render component, rendered text component span on whole line, and applying it to the renderer itself does nothing as it is intended to be inline rather than blockThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense to keep the same styling layout across platforms as much as possible. This will reduce the complexity. For now, we have a simple solution that works so let's go with that.