Skip to content

readonly option not documented ignoreReadonly not working #390

@inuryuutarou

Description

@inuryuutarou

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions