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

bug: clearOnEdit should not clear input when tabbing to next input #27746

Closed
3 tasks done
jmedellinc opened this issue Jul 5, 2023 · 3 comments · Fixed by #28005
Closed
3 tasks done

bug: clearOnEdit should not clear input when tabbing to next input #27746

jmedellinc opened this issue Jul 5, 2023 · 3 comments · Fixed by #28005
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@jmedellinc
Copy link

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

The clearOnEdit option of ion-input is supposed to clear the content of the ion-input when a new character is entered

If filling a form with the keyboard, if you tab into an input which has contents and then you tab into another input, the input clears, which i think is not what's expected?

Expected Behavior

The input should not be erased if the input "entered" is the tab key..

Steps to Reproduce

  1. Go to https://ionicframework.com/docs/api/input#clear-options
  2. Activate the text input which has clearOnEdit activated
  3. tab change into the following input
  4. Shift-Tab into the previous input, which results in the input with clearOnEdit option activated and it has already text
  5. Tab again to change into the next input
  6. ... the input clears..

Code Reproduction URL

https://ionicframework.com/docs/api/input#clear-options

Ionic Info

Latest.. Test based on ionic Docs

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Jul 5, 2023
@liamdebeasi liamdebeasi changed the title bug: clearOnEdit (ion-input) identifies TAB as edit bug: clearOnEdit should not clear input when tabbing to next input Jul 5, 2023
@liamdebeasi liamdebeasi added package: core @ionic/core package type: bug a confirmed bug report labels Jul 5, 2023
@ionitron-bot ionitron-bot bot removed triage labels Jul 5, 2023
@liamdebeasi
Copy link
Contributor

Thanks for the report. Here is a dev build with a proposed fix if you are interested in testing: 7.3.1-dev.11692202566.13cd16c4

Install Example: npm install @ionic/[email protected]

github-merge-queue bot pushed a commit that referenced this issue Aug 18, 2023
…28005)

Issue number: resolves #27746

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

Pressing the Tab key when focused on an input/textarea with
`clearOnEdit` clears the text field and then moves focus to the next
focusable element.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Pressing the Tab key does not clear the text field even when
clearOnEdit is enabled.
- Added test coverage
- I also noticed that input did not have an `index.html` file in the
basic directory, so I added that.

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

Dev build: `7.3.1-dev.11692202566.13cd16c4`
@liamdebeasi
Copy link
Contributor

Thanks for the issue. This has been resolved via #28005, and a fix will be available in an upcoming release of Ionic Framework. Feel free to keep testing the dev build, and let me know if you have any questions.

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 17, 2023

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants