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

Projects
None yet
3 participants
@konnectappdev
Copy link
Contributor

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 label Apr 9, 2019

@liamdebeasi
Copy link
Member

left a comment

Looks good! Just need to add stopPropagation.

Show resolved Hide resolved core/src/components/input/input.tsx

liamdebeasi added some commits Apr 16, 2019

@liamdebeasi liamdebeasi merged commit 29bb4fc into ionic-team:master Apr 16, 2019

1 check passed

build Workflow: build
Details
@liamdebeasi

This comment has been minimized.

Copy link
Member

commented Apr 16, 2019

Merged. Thank you! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.