Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

fix(text-field): Don't move caret when value has not changed #4160

Merged
merged 4 commits into from
Dec 14, 2018

Conversation

developit
Copy link
Contributor

This fixes an issue where the cursor on Mobile Safari will be reset to its end position any time .setValue() is called.

This fixes an issue where the cursor on Mobile Safari will be reset to its end position any time `.setValue()` is called.
@johnhaitas
Copy link

This fixes an issue where the cursor on Mobile Safari will be reset to its end position any time .setValue() is called.

This bug also occurs with MacOS Safari

@acdvorak acdvorak self-requested a review December 13, 2018 21:48
@acdvorak acdvorak self-assigned this Dec 13, 2018
@codecov-io
Copy link

Codecov Report

Merging #4160 into master will increase coverage by 0.33%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4160      +/-   ##
==========================================
+ Coverage    98.5%   98.84%   +0.33%     
==========================================
  Files         127      127              
  Lines        5628     5629       +1     
  Branches      746      747       +1     
==========================================
+ Hits         5544     5564      +20     
+ Misses         84       65      -19
Impacted Files Coverage Δ
packages/mdc-textfield/foundation.js 98.98% <100%> (ø) ⬆️
packages/mdc-checkbox/index.js 100% <0%> (+1.2%) ⬆️
packages/mdc-ripple/index.js 100% <0%> (+2.08%) ⬆️
packages/mdc-auto-init/index.js 100% <0%> (+2.77%) ⬆️
packages/mdc-tab/index.js 96.49% <0%> (+3.5%) ⬆️
packages/mdc-ripple/util.js 100% <0%> (+3.5%) ⬆️
packages/mdc-base/component.js 100% <0%> (+4.16%) ⬆️
packages/mdc-switch/index.js 97.95% <0%> (+6.12%) ⬆️
packages/mdc-tabs/tab/index.js 100% <0%> (+9.09%) ⬆️
packages/mdc-radio/index.js 97.43% <0%> (+12.82%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update de6c833...8beb4c2. Read the comment docs.

@acdvorak acdvorak changed the title Avoid re-assigning input value when unchanged fix(text-field): Don't move caret when value has not changed Dec 14, 2018
Copy link
Contributor

@acdvorak acdvorak left a comment

Choose a reason for hiding this comment

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

Made a small edit to fix some failing unit tests, but otherwise LGTM. Thanks developit@!

@acdvorak acdvorak merged commit d55ca11 into material-components:master Dec 14, 2018
adrianschmidt pushed a commit to Lundalogik/material-components-web that referenced this pull request Jan 4, 2019
…l-components#4160)

This fixes an issue where the cursor on Safari will be reset to its end position any time `.setValue()` is called.

(cherry picked from commit d55ca11)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants