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

Cutting text from a readonly input should not remove text #549

Open
kalmancsaba opened this issue Jan 10, 2020 · 0 comments · May be fixed by #633
Open

Cutting text from a readonly input should not remove text #549

kalmancsaba opened this issue Jan 10, 2020 · 0 comments · May be fixed by #633

Comments

@kalmancsaba
Copy link

Cutting text (Ctrl+X) from an ordinary readonly input element does not remove the text.

With Cleave however, selecting the entire content of a readonly input element and pressing Ctrl+X removes the text.

Please check the readonly property of the element before calling this.onInput(''); in function onCut:

onCut: function (e) {
    if (!Cleave.Util.checkFullSelection(this.element.value)) return;
    this.copyClipboardData(e);
    if (!this.element.readonly) {
        this.onInput('');
    }
},
kalmancsaba added a commit to kalmancsaba/cleave.js that referenced this issue Dec 4, 2020
Cutting text (Ctrl+X) from a read-only <input> field no longer removes the text.

Fixes nosir#549
@kalmancsaba kalmancsaba linked a pull request Dec 4, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant