Skip to content

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

Merged
liamdebeasi merged 5 commits into
ionic-team:masterfrom
konnectappdev:fix-ion-input-loses-focus
Apr 16, 2019
Merged

liamdebeasi merged 5 commits into
ionic-team:masterfrom
konnectappdev:fix-ion-input-loses-focus

Conversation

@konnectappdev

@konnectappdev konnectappdev commented Apr 9, 2019 •

Copy link
Copy Markdown
Contributor

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

@liamdebeasi liamdebeasi left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread core/src/components/input/input.tsx Resolved
@liamdebeasi
liamdebeasi merged commit 29bb4fc into ionic-team:master Apr 16, 2019
@liamdebeasi

Copy link
Copy Markdown
Contributor

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.

3 participants