Skip to content

Commit

Permalink
Merge pull request #213 from gushil/main-disable-paste-readonly-mode
Browse files Browse the repository at this point in the history
Fixed:  User can paste value into read-only date field
  • Loading branch information
svadla-oc authored Oct 7, 2024
2 parents 0abefc5 + bab4d9c commit 4ef5f28
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/enketo-core/src/widget/date/datepicker-extended.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,12 @@ class DatepickerExtended extends Widget {
_setChangeHandler($fakeDateI) {
const { settings } = this;

$fakeDateI.on('change paste', (e) => {
let changeEvent = 'change';
if (!$fakeDateI.closest('label').hasClass('readonly')) {
changeEvent += ' paste';
}

$fakeDateI.on(changeEvent, (e) => {
let convertedValue = '';
let value =
e.type === 'paste'
Expand Down

0 comments on commit 4ef5f28

Please sign in to comment.