Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

### Fixed

- Auto-complete select error when input is empty (TypeError: Cannot read properties of undefined (reading 'length'))
- Minus is being deleted with the first digit #2860
- Problems with deleting static chars in alternator mask #2648
- Backspace on controlled input adds "backspace" text to the value #2865
Expand Down
17 changes: 13 additions & 4 deletions dist/colormask.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions dist/colormask.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions dist/inputmask.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions dist/inputmask.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions dist/jquery.inputmask.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions dist/jquery.inputmask.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions inputmask-pages/src/assets/Changelog.md

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Don't update this file as It will be updated by the build process automatically.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reverted in 30f5dbf.

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

### Fixed

- Minus is being deleted with the first digit #2860
- Problems with deleting static chars in alternator mask #2648
- Backspace on controlled input adds "backspace" text to the value #2865
- Cannot read properties of null (reading 'inputmask') FormData patch #2841
Expand Down
15 changes: 12 additions & 3 deletions lib/eventhandlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,18 @@ const EventHandlers = {
}, 0);
break;
case "deleteContentBackward":
var keydown = new $.Event("keydown");
keydown.key = keys.Backspace;
EventHandlers.keyEvent.call(input, keydown);
if (e.inputType && e.inputType.startsWith("insert")) {
// e.inputType indicates an insert operation (e.g. browser autocomplete
// with insertReplacementText) but analyseChanges incorrectly detected
// a deletion due to caret position / buffer length mismatch.
// Apply the value directly instead of dispatching a backspace event.
applyInputValue(input, inputValue);
caret.call(inputmask, input, caretPos.begin, caretPos.end, true);
} else {
var keydown = new $.Event("keydown");
keydown.key = keys.Backspace;
EventHandlers.keyEvent.call(input, keydown);
}
break;
default:
applyInputValue(input, inputValue);
Expand Down