-
Notifications
You must be signed in to change notification settings - Fork 734
Dialog - useHiddenLocation, added reduce motion listener for testing on Android. #3739
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: master
Are you sure you want to change the base?
Conversation
const [reduceMotionEnabled, setReduceMotionEnabled] = useState(false); | ||
|
||
useEffect(() => { | ||
AccessibilityInfo.isReduceMotionEnabled().then(setReduceMotionEnabled); |
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.
Look in Constants
-> accessibility
is set with a promise, we can probably add the info there IMO.
const getHiddenLocation = ({ | ||
x = 0, | ||
y = 0, | ||
width = Constants.screenWidth, | ||
height = Constants.windowHeight, | ||
wasMeasured = wasMeasuredDefaultValue | ||
}): HiddenLocation => { | ||
if (Constants.isAndroid && reduceMotionEnabled) { | ||
return defaultHiddenLocation; |
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.
Isn't this just getHiddenLocation({})
?
Maybe you can do it some other way?
…wix/react-native-ui-lib into fix/Diloag_reductionMouvement_state_fix
@M-i-k-e-l After changing the |
|
|
Let's verify it is reproduced with the old changes, if it does let's only keep the fix here and test in private |
@M-i-k-e-l as we saw yesterday even with this fix the issue still reproduce. |
Description
Dialog component only showed overlay (no content) when isReduceMotionEnabled was set to true on Android, content was positioned off-screen with no animation to bring it into view.
Fix:
Centralized accessibility state: Added isReduceMotionEnabled to Constants.accessibility following the existing pattern.
Fixed Dialog animations: Modified Dialog's open() and close() functions to respect reduce motion preference
Changes:
React native docs
Changelog
Fix Dialog component only showed overlay (no content) when isReduceMotionEnabled was set to true on Android.
Additional info
Slack thread in support channel