-
-
Notifications
You must be signed in to change notification settings - Fork 779
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
Porting BottomSheet accessibility from v2 to v4 #1288
Conversation
Awesome work <3 This missing functionality is what is keeping us on v2 of this library! |
Would love to see this merged in 👍 |
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
Commenting to keep this open - would be a real help if this gets merged in. |
@gorhom any chance of this going in soon? 🙏 |
We would very much also like to get this merged in. @gorhom |
@gorhom Is this change available in 4.4.6 ? |
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
Please keep this open - we are still longing for it! |
Hi @gorhom I'm sure you are super busy maintaining this awesome library, but can we at least get a comment on why this PR is not getting any attention? To me it is a fairly small PR that only adds some accessibility capabilities and doesn't touch any core functionality that risks breaking the lib. Please just give us a small sign of life from you and let us know if there is anything we can do in order to get this merged <3 |
Hi @gorhom I see you have assigned yourself to this PR some time ago now, do you have any ETA on when we can get this reviewed and approved? We are still very much waiting on this. ❤️ |
@gorhom Please can you take a quick look at this and merge it in? My app cares about users with accessibility requirements so we really need this |
Any news on this? its still an issue |
Hi again @gorhom We are currently running on an old forked version of your awesome lib, but now we have to bump in order to get to use reanimated v3. However, since v4 of this lib still doesn't cater for accessibility users, we will unfortunately have to create a new fork of
I believe this PR is fairly simple as it doesn't touch any core or complex functionality but instead just adds some additional accessibility props but if there is something that you would like to have done in a different way, please at least provide us with a review and some feedback on whatever is holding you back from reviewing/approving/merging this PR. If you have been inactive on this PR because you think "accessibility" is just dull and doesn't matter (I don't blame you if you do - I did so too) I think the EEA and below quote shows that accessibility is actually quite important and is more and more becoming a standard requirement/expected feature both by end users as well as developers:
Looking forward to hear an answer from you that can hopefully stop our process of forking yet another version of Best regards |
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.
Hi @Mahmoud-SK
I've added some review comments to your PR in order to maybe make the change a little smaller in an attempt to maybe get this merged/prioritized.
Let me know what you think.
Best regards
Jens
accessibilityRole={_providedAccessibilityRole ?? undefined} | ||
accessibilityLabel={_providedAccessibilityLabel ?? undefined} | ||
accessibilityHint={_providedAccessiblityHint ?? undefined} | ||
{...rest} |
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.
@Mahmoud-SK why is the spread of the rest
props needed?
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.
It's needed to pass the rest of the properties to the Animated.View - in this case it's only animatedPosition-prop.
accessible={_providedAccessible ?? undefined} | ||
accessibilityRole={_providedAccessibilityRole ?? undefined} | ||
accessibilityLabel={_providedAccessibilityLabel ?? undefined} | ||
accessibilityHint={_providedAccessiblityHint ?? undefined} |
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.
@Mahmoud-SK can we maybe do this in order to not break the existing behaviour?
accessibilityHint ={_providedAccessiblityHint ? _providedAccessibilityHint : `Tap to ${
typeof pressBehavior === 'string' ? pressBehavior : 'move'
} the Bottom Sheet`}
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.
Done. :)
@@ -323,7 +341,7 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>( | |||
const extendedPositionWithKeyboard = Math.max( | |||
0, | |||
animatedContainerHeight.value - | |||
(animatedSheetHeight.value + keyboardHeightInContainer) | |||
(animatedSheetHeight.value + keyboardHeightInContainer) |
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 think this was correctly indented before - can you revert this change?
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.
It looks correctly indented locally, so I'm not completely sure why it shows it like this.
adjustedSnapPoints, | ||
adjustedSnapPointsIndexes, | ||
Extrapolate.CLAMP | ||
) |
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 think this was correctly indented before - can you revert this change?
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.
Same as the previous comment, locally it's indented.
) | ||
_keyboardHeight - | ||
Math.abs(bottomInset - animatedContainerOffset.value.bottom) | ||
) |
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.
Wasn't this also correctly indented before?
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.
Same as the previous comment, locally it's indented.
accessibilityRole={_providedAccessibilityRole ?? undefined} | ||
accessibilityLabel={_providedAccessibilityLabel ?? undefined} | ||
accessibilityHint={_providedAccessiblityHint ?? undefined} | ||
{...rest} | ||
> | ||
{children} | ||
</Animated.View> |
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 think you also need to add the accessibility props to the <Animated.View>
below:
<Animated.View
style={containerStyle}
pointerEvents={pointerEvents}
accessible={_providedAccessible ?? undefined}
accessibilityRole={_providedAccessibilityRole ?? undefined}
accessibilityLabel={_providedAccessibilityLabel ?? undefined}
accessibilityHint={_providedAccessibilityHint ?? undefined}
{...rest}
>
{children}
</Animated.View>
Maybe add this to a local const and use that because it is the exact same component as is used inside <TapGestureHandler/>
when pressBehavior !== 'none'
.
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.
Good idea, done.
Hi all, is there anything stopping for this branch to be merged? |
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.
thanks @Mahmoud-SK, for submitting this pr, i have left some comments. and most importantly i think we should not introduce the change announcement, since i believe it is on the user to set it up not the library.
Hi @gorhom I've went ahead and done the changes that you requested. 😄 Could you please have a look again? Thanks in advance! |
thanks @Mahmoud-SK for submitting this PR, i appreciate your amazing work 🙌 this should be release on the next few days |
Awesome news, @gorhom! The accessibility features were once added to V2 but were not added to newer versions of the lib. Will the changes in this PR be added to V5 or should we create a separate PR for that towards the V5 branch? Just to avoid having to request this feature again for the next major version. |
* Added accessibility to the bottomSheet component * Accessibility changes - BottomSheetBackdrop * Accessibility changes - BottomSheetHandle * Minor adjustments after review * removed unused spread operator * fix: removed change announcement removed the change announcement part of the code, and the ..rest from the two mentioned files.
* Added accessibility to the bottomSheet component * Accessibility changes - BottomSheetBackdrop * Accessibility changes - BottomSheetHandle * Minor adjustments after review * removed unused spread operator * fix: removed change announcement removed the change announcement part of the code, and the ..rest from the two mentioned files.
I have already cherrypicked this PR into v5 latest release 👏 |
Hi, can you take a look at this question? #1560 (comment) |
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.
@gorhom we recently updated our fork of this library and this commit broke VoiceOver for all of our sheets. I don't think this change makes sense for any sheet that would have interactive content in it (which I imagine is most?).
I would recommend reverting, this doesn't improve accessibility at all.
accessibilityHint={`Tap to ${ | ||
typeof pressBehavior === 'string' ? pressBehavior : 'move' | ||
} the Bottom Sheet`} | ||
accessible={_providedAccessible ?? undefined} |
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.
Why would you mark the root View
as accessible
for the bottom sheet? That makes it so you cannot focus any of the descendant views (which is all of the sheet content) with VoiceOver on iOS.
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.
Yep, just tested this and this is the problem I'm seeing as well. @flo-sch I see you just opened an accessibility PR, did you want to take a look at this as well there?
…Mahmoud-SK)" This reverts commit 2dea730
@gorhom We also had to revert this for the same reasons aweary mentioned. I think it would probably be a good idea revert as well, especially if this has made it's way into v5. |
Motivation
I'm picking up this task of porting accessibility features from V2 to V4 as per #548