-
Notifications
You must be signed in to change notification settings - Fork 1k
Add focus indicator theme option #7490
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
Add focus indicator theme option #7490
Conversation
Co-authored-by: Jessica Rosenquist <54560994+jcfilben@users.noreply.github.com>
Co-authored-by: Jessica Rosenquist <54560994+jcfilben@users.noreply.github.com>
return cloneElement(child, { | ||
focusIndicator: modifiedFocusIndicator, | ||
}); | ||
} | ||
return cloneElement(child, { | ||
plain: true, | ||
focusIndicator: false, |
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.
Could the above "if (wantFocusIndicator) condition be removed and just change the existing return to be:
return cloneElement(child, {
plain: true,
focusIndicator: theme.formField?.focus?.containerFocus === true ? false : true,
...
Co-authored-by: Taylor Seamans <taylor.seamans@yahoo.com>
Co-authored-by: Taylor Seamans <taylor.seamans@yahoo.com>
Co-authored-by: Taylor Seamans <taylor.seamans@yahoo.com>
Co-authored-by: Taylor Seamans <taylor.seamans@yahoo.com>
Co-authored-by: Taylor Seamans <taylor.seamans@yahoo.com>
Co-authored-by: Taylor Seamans <taylor.seamans@yahoo.com>
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.
Behavior looks good. Thank you!
…britt6612/grommet into add-focusIndicator-theme-option
good catch @jcfilben fixed now! |
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.
Looks good!
What does this PR do?
This PR adds an option in the theme to remove the
focusIndicator
from Formfield.Where should the reviewer start?
FormField.js
What testing has been done on this PR?
locally & wrote a test
test could use some work
How should this be manually tested?
locally
Do Jest tests follow these best practices?
screen
is used for querying.asFragment()
is used for snapshot testing.Any background context you want to provide?
It's desirable to be able to set a flag in the theme to allow focus to be placed on the individual Checkbox/RadioButton/etc directly (following native browser behavior) rather than stealing it to place on formfield.
What are the relevant issues?
closes #7486
Screenshots (if appropriate)
Do the grommet docs need to be updated?
yes
Should this PR be mentioned in the release notes?
yes
Is this change backwards compatible or is it a breaking change?
backwards compatible