Skip to content

.disable() does not add a disabled attribute to the input element #307

Closed
@Pym

Description

@Pym
$select_region = $('#form_region').selectize();
select_region = $select_region[0].selectize;
select_region.disable();

gives me:

<select id="form_region" name="form[region]" required="required" class="selectized" placeholder="Region" tabindex="-1" disabled="" style="display: none;">
    <option value="" selected="selected"></option>
</select>
<div class="selectize-control single">
    <div class="selectize-input items required not-full has-options invalid disabled locked">
        <input type="text" autocomplete="off" tabindex="" placeholder="Choose a region" required="" style="width: 173px; opacity: 1; position: relative; left: 0px;">
    </div>
    <div class="selectize-dropdown single" style="display: none; width: 301px; top: 36px; left: 0px; visibility: visible;">
        <div class="selectize-dropdown-content">
            <div data-value="1" data-selectable="" class="option">first</div>
        </div>
    </div>
</div>

The problem here is that because the input is not disabled, the browser will prevent the user to send the form. I don't think that it's the expected behavior. Can you please fix this?

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