-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat(SearchBarIos): new prop option omitCancel
#3833
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
Conversation
✅ Deploy Preview for react-native-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
I'm not sure if we are supposed to also modify the documentation pages that are in the repo (which is what I did), I'm not sure if this may have caused it not to pass some checks by Netlify. Please let me know if there is anything wrong with the PR!
omitCancel (追記ここまで)
I feel adding more props would lead to more confusion. I would rather update the current showCancel prop to accept more values with current boolean value.
Uh oh!
There was an error while loading. Please reload this page.
Motivation
I'm always frustrated when the showCancel Prop (for platform="ios" only) on the SearchBar component from @rneui/base only defines whether or not to persist the cancel button beside the searchbar when unfocused. I wanted to see an option that let the developer omit the cancel button from the SearchBar, resulting in a cleaner UI when the button is not necessary. I created a new prop called
omitCancel:booleanthat defaults asfalse. WhenomitCancel={true}, it will completely omit the cancel button on SearchBars withplatform="ios", so it will never appear regardless of it being focused or not.Fixes: Creates new prop called
omitCancel:booleanthat defaults asfalseType of change
How Has This Been Tested?
Checklist
yarn docs-build-apiAdditional context
In the below image, the cancel button is omitted while maintaining the rest of the native iOS styles.
image