-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Conflicting states for accessibility and non-accessibility users…
… (#354) * adding accessibilityState.disabled prop to Slider.js * removing java logic to trigger accessibility disabled announcement * jest tests accessiblityState.disabled and disabled prop * update jest snapshots * adding invariant check on disabled prop type Flow check on master seems to not work fabOnReact/react-native-notes#2 (comment) As an alternative I implemented an invariant check. https://github.com/fabriziobertoglio1987/react-native/blob/76a2cf3569571b943b4bcc6867e069338ff88f1f/Libraries/Lists/VirtualizedList.js#L1240-L1245 https://github.com/zertosh/invariant * adding Slider disabled example * trigger invariant error when props.disabled is null * remove check on prop type commit 16d321b I will try to fix .flowconfig and enable flow type checking for Slider props * improve test cases descriptions * add LogBox (console.warn) message to notify developer conflicting accessibility disabled state * update LogBox warning text * remove LogBox warning * jest fix obsolete snapshots * Add test for reverted disabled/enabled case There's already a test, where disabled={true} is checked against accessibilityState={{disabled: false}}, but to double check all the combinations this commit adds new test that acts as the inverted scenario to make sure that conflicts are avoided both directions. * avoid conflicting disabled states It would be better to show that both these properties can be used separately without fear of another. callstack/react-native-slider#354 (comment) Co-authored-by: BartoszKlonowski <Bartosz.Klonowski@callstack.com>
- Loading branch information
1 parent
a183fb6
commit 1a46f1e
Showing
5 changed files
with
146 additions
and
14 deletions.
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
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