Repository navigation
fix(switch): #5222 followup - does not warn when readOnly is set without onValueChange test fix - #5240
Open
jacekAtCK wants to merge 1 commit into
Open
fix(switch): #5222 followup - does not warn when readOnly is set without onValueChange test fix#5240jacekAtCK wants to merge 1 commit into
jacekAtCK wants to merge 1 commit into
Conversation
|
Found potential problems with the pull request:
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 3 new findings on 9924209. The verdict and the full list are in the summary comment.
Collaborator
Author
|
/review |
Apex Sentinel · ✅ Approve · review of
|
| Where | Finding |
|---|---|
src/components/Switch/Switch.tsx:465 |
Focused non-interactive switch on web loses its only focus indicator (disabled too, not just readOnly) |
1 finding below minor hidden (user_settings.min_severity).
Reviewed with this repository's own Sentinel configuration (c8c3a3945ccb).
💬 Talking to Sentinel
In a finding's thread, reply with:
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Follow-up to #5222, from the review in #5222 (comment).
The test "does not warn when readOnly is set without onValueChange" failed when it ran by itself. The first
Switchrender in a Jest worker also logs the one-time Reanimated warnings, soconsole.warngot 4 calls. The test now checks only for theSwitch:warning, so the result does not depend on the order of the tests.This PR also makes the four smaller changes from the same review:
Switchon web no longer rendersaria-readonly="false". The attribute is set only when the switch is read-only.Switchon web that cannot be operated hides the outline of the browser. Before, a switch that had keyboard focus when it became read-only kept DOM focus and showed the default browser outline. This also applies to a disabled switch.aria-label="Read-only", so a screen reader has a name to announce.TertiarySwitchin the migration guide are typed, so the snippet compiles understrict.Related issue
Follow-up to #5222.
Screenshots / Videos
No visual change, except that the browser outline does not show in the case above.
Test plan
In the Switch example on web:
aria-readonlyattribute.aria-readonly="true".