Skip to content
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

fix(input): prevent default behaviour on clear text input button #18004

Merged

Conversation

konnectappdev
Copy link
Contributor

@konnectappdev konnectappdev commented Apr 9, 2019

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Build (npm run build) was run locally and any changes were pushed
  • Lint (npm run lint) has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • Bugfix

What is the current behavior?

When clear-input is used on a input field it loses focus on that field whenever the input is cleared

Issue Number: #18002

What is the new behavior?

A check has been added to prevent default behaviour of the clear-input button, This causes the input field to lose focus. A check is added to only apply this logic whenever the clear-input button is shown since this function is also used for clear-on-edit but would make no sense to apply in that scenario.

Does this introduce a breaking change?

  • No

@ionitron-bot ionitron-bot bot added the package: core @ionic/core package label Apr 9, 2019
Copy link
Member

@liamdebeasi liamdebeasi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just need to add stopPropagation.

core/src/components/input/input.tsx Show resolved Hide resolved
@liamdebeasi liamdebeasi merged commit 29bb4fc into ionic-team:master Apr 16, 2019
@liamdebeasi
Copy link
Member

Merged. Thank you! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants