-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[RNMobile] Disable block's touchable component when is focused #49691
[RNMobile] Disable block's touchable component when is focused #49691
Conversation
@@ -215,7 +215,7 @@ class BlockListBlock extends Component { | |||
order + 1 | |||
); | |||
const { isFullWidth, isContainerRelated } = alignmentHelpers; | |||
const accessible = ! ( isSelected || isInnerBlockSelected ); | |||
const isFocused = isSelected || isInnerBlockSelected; |
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.
I considered the block as focused when is selected or when any of its inner blocks is selected.
Size Change: 0 B Total Size: 1.37 MB ℹ️ View Unchanged
|
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.
I tested this out a few different embed based blocks.
It's working as expected in all cases.
Awesome work!
Hey @jhnstn 👋 , would you mind also reviewing the GB-mobile PR? Thanks 🙇 ! |
What?
Disables the touchable component (
TouchableWithoutFeedback
) used inBlockListBlock
component to gain focus when the block is already focused (i.e. selected or has an inner block selected).Why?
On Android, we detected that touchable components, like
TouchableWithoutFeedback
, can disrupt touch events of inner components. Specifically, elements rendered within WebViews don't receive properly the touch events and break interaction of embedded content.How?
When a block is focused (i.e. selected or has an inner block selected), the
TouchableWithoutFeedback
component, used to gain focus and select the block, is disabled via thedisabled
prop. This change shouldn't introduce regressions as it's expected that selected blocks don't get selected again:gutenberg/packages/block-editor/src/components/block-list/block.native.js
Lines 132 to 137 in 38c1276
Testing Instructions
Blocks can be selected
Inner blocks can be selected
N/A
Testing Instructions for Keyboard
N/A
Screenshots or screencast
N/A