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

[Accessible Pressable] Create GenericPressable, PressableWithFeedback, PressableWithoutFeedback #17404

Merged
merged 48 commits into from
Apr 27, 2023
Merged
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
8c60699
create move focus functions for web and native
robertKozik Apr 12, 2023
8c823da
create useScreenReaderStatus hook
robertKozik Apr 12, 2023
737f6dc
create base pressable files structure
robertKozik Apr 12, 2023
ecec5eb
create base GenericPressable component
robertKozik Apr 13, 2023
d3b843e
add hitSlop calculation for pressable component
robertKozik Apr 13, 2023
d8eec98
calculate disabled state before GenericPressable return, wrap press h…
robertKozik Apr 13, 2023
dba339f
fix wrong import of propTypes to GenericPressable
robertKozik Apr 13, 2023
47035c3
update OpacityView to use reanimated and enable dimming to multiple o…
robertKozik Apr 17, 2023
46241f1
fix GenericPressable implementation – passing disabled prop to Pressa…
robertKozik Apr 17, 2023
d270158
correctly set up hitslop for useAutoHitSlop
robertKozik Apr 17, 2023
ee2e3b0
set up PressableWithFeedback component
robertKozik Apr 17, 2023
fd21d4e
set up PressableWithoutFeedback component
robertKozik Apr 17, 2023
3dbea09
comment GenericPressable propTypes
robertKozik Apr 18, 2023
784889b
fix unsubscribing screen reader listener
robertKozik Apr 18, 2023
2830923
update GenericPresssable implementation
robertKozik Apr 18, 2023
038960a
undim opacityView with timing
robertKozik Apr 19, 2023
0d81a56
update comments on OpacityView propTypes
robertKozik Apr 19, 2023
7b1fe9a
simplify useScreenReaderStatus useEffect hook
robertKozik Apr 19, 2023
d5204e9
extract possible screen reader states to const file
robertKozik Apr 19, 2023
0491515
fix typo
robertKozik Apr 19, 2023
83718b7
simplify switch statment to two if's
robertKozik Apr 19, 2023
6cc7fd7
hoist pareStyleFromFunction to StyleUtils file
robertKozik Apr 19, 2023
19ebe88
add JSDoc for getCursorStyle function
robertKozik Apr 19, 2023
bd9bbbb
rename GenericPressable to BaseGenericPressable
robertKozik Apr 20, 2023
92c826e
split accessibility props to native and web implementations
robertKozik Apr 24, 2023
f95fc73
rename proptypes object passed to different components
robertKozik Apr 24, 2023
85b7d02
ensure blurring after interaction
robertKozik Apr 24, 2023
7ef33d0
fix wrong propTypes import
robertKozik Apr 24, 2023
90482d1
patch propTypes related warnings
robertKozik Apr 24, 2023
c7141db
adjust action order of haptic, blur, onPress as specified in design doc
robertKozik Apr 24, 2023
cf76372
prevent onPressIn and onPressOut from fire when component is disabled
robertKozik Apr 25, 2023
a19c8e0
change to underscore library
robertKozik Apr 26, 2023
8e5547e
fix camelCase issue
robertKozik Apr 26, 2023
72d983c
return remove subscription from addEventListener immediately
robertKozik Apr 26, 2023
fe9611c
fix typo in omittedProps
robertKozik Apr 26, 2023
c0e77c6
remove redundant eslint disable comment
robertKozik Apr 26, 2023
9243829
make GenericPressable comment more precise
robertKozik Apr 26, 2023
e20f562
update GenericPressable propTypes
robertKozik Apr 27, 2023
1cdea8a
use hoverDimValue from variables as default OpacityView value
robertKozik Apr 27, 2023
9e221e2
fix wrong style name in GenericPressable
robertKozik Apr 27, 2023
8ad2923
address the arbitrary minimum value of tappable area inside getHitSlo…
robertKozik Apr 27, 2023
6ba7f1b
Merge branch 'main' into generic-pressable
robertKozik Apr 27, 2023
7bfc422
fix typo
robertKozik Apr 27, 2023
2006a89
fix wrong prop name inside default props
robertKozik Apr 27, 2023
27ba2fa
use platform specific cursor utility in BaseGenericPressable
robertKozik Apr 27, 2023
0e85364
Change order of imports
robertKozik Apr 27, 2023
72af27b
Remove unintended whitespace
robertKozik Apr 27, 2023
66782e5
update Pressable proppType example
robertKozik Apr 27, 2023
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
Prev Previous commit
Next Next commit
fix unsubscribing screen reader listener
  • Loading branch information
robertKozik committed Apr 24, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 784889b25a35228327426fb76cd12d4e40e418b6
7 changes: 5 additions & 2 deletions src/libs/Accessibility/index.js
Original file line number Diff line number Diff line change
@@ -6,12 +6,15 @@ import moveAccessibilityFocus from './moveAccessibilityFocus';
const useScreenReaderStatus = () => {
const [isScreenReaderEnabled, setIsScreenReaderEnabled] = useState(false);
useEffect(() => {
robertKozik marked this conversation as resolved.
Show resolved Hide resolved
const unsubscribe = AccessibilityInfo.addEventListener('screenReaderChanged', (isEnabled) => {
const subscription = AccessibilityInfo.addEventListener('screenReaderChanged', (isEnabled) => {
setIsScreenReaderEnabled(isEnabled);
});

return () => {
robertKozik marked this conversation as resolved.
Show resolved Hide resolved
unsubscribe();
if (!subscription) {
return;
}
subscription.remove();
};
}, []);