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

readonly option not documented ignoreReadonly not working #390

Open
inuryuutarou opened this issue Mar 26, 2024 · 0 comments
Open

readonly option not documented ignoreReadonly not working #390

inuryuutarou opened this issue Mar 26, 2024 · 0 comments

Comments

@inuryuutarou
Copy link

inuryuutarou commented Mar 26, 2024

I have problem with ignoreReadonly that each time i set my input as readonly it would always remove those attribute somehow..
so I do some debug and find that there is this readonly option in line 1109

this._options.readonly = _readonly;

      if (this.input !== undefined) {
        this.input.prop('readonly', this._options.readonly);
      }

So I add the readonly:true, but this give some other problem as the dates is not clickable at all.. even when i already use ignoreReadonly:true and again I check the code and find this in line 2253

if (this.input !== undefined && this.input.prop('readonly') || this._options.readonly) {
         template.addClass('bootstrap-datetimepicker-widget-readonly');
      }

so this two option is somehow not supporting each other..
I change the condition to

if ((this.input !== undefined && this.input.prop('readonly') || this._options.readonly)&&this._options.ignoreReadonly==false) {
         template.addClass('bootstrap-datetimepicker-widget-readonly');
      }

And it work as how I intended it to be.. may this post able to help anyone that experience same issue as me..

and in the minified JS if you want, you could change this part from

(void 0!==this.input&&this.input.prop("readonly")||this._options.readonly)

into

(void (0!==this.input&&this.input.prop("readonly")||this._options.readonly)&&this._options.ignoreReadonly==false)

just use find to search the code and replace it.

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

No branches or pull requests

1 participant