We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a9860f commit 0055cbcCopy full SHA for 0055cbc
lib/web/mage/trim-input.js
@@ -41,9 +41,18 @@ define([
41
* @private
42
*/
43
_trimInput: function () {
44
+ // Safari caret position workaround: storing carter position
45
+ const caretStart = this.options.cache.input.get(0).selectionStart;
46
+ const caretEnd = this.options.cache.input.get(0).selectionEnd;
47
+
48
var input = this._getInputValue().trim();
49
50
this.options.cache.input.val(input);
51
52
+ // Safari caret position workaround: setting caret position to previously stored values
53
+ if (caretStart !== null && caretEnd !== null) {
54
+ this.options.cache.input.get(0).setSelectionRange(caretStart, caretEnd);
55
+ }
56
},
57
58
/**
0 commit comments