Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
coderpr0grammer wants to merge 4 commits into react-native-elements:next
base: next
Choose a base branch
Loading
from coderpr0grammer:next

Conversation

@coderpr0grammer
Copy link

@coderpr0grammer coderpr0grammer commented Aug 29, 2023
edited
Loading

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:boolean that defaults as false. When omitCancel={true}, it will completely omit the cancel button on SearchBars with platform="ios", so it will never appear regardless of it being focused or not.

Fixes: Creates new prop called omitCancel:boolean that defaults as false

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

  • Checked with my own app

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation using yarn docs-build-api
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Additional context

In the below image, the cancel button is omitted while maintaining the rest of the native iOS styles.
image

Copy link

netlify bot commented Aug 29, 2023
edited
Loading

Deploy Preview for react-native-elements ready!

Name Link
🔨 Latest commit f8cb2ff
🔍 Latest deploy log https://app.netlify.com/sites/react-native-elements/deploys/64ed7afb11285500085d5ace
😎 Deploy Preview https://deploy-preview-3833--react-native-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Edgarruiz85 reacted with heart emoji

@coderpr0grammer coderpr0grammer changed the title (削除) Make the showCancel prop actually hide or show the cancel button (削除ここまで) (追記) [New feature] New prop option "omitCancel" for SearchBar component where platform="ios" (追記ここまで) Aug 29, 2023
Copy link
Author

@coderpr0grammer coderpr0grammer left a 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!

Edgarruiz85 reacted with heart emoji
@arpitBhalla arpitBhalla changed the title (削除) [New feature] New prop option "omitCancel" for SearchBar component where platform="ios" (削除ここまで) (追記) feat(SearchBarIos): new prop option omitCancel (追記ここまで) Sep 9, 2023
Copy link
Member

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.

Edgarruiz85 reacted with heart emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@pranshuchittora pranshuchittora Awaiting requested review from pranshuchittora

@khushal87 khushal87 Awaiting requested review from khushal87

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /