question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Initialized select input with readonly="true" attribute displays cursor on Safari mobile (iPhone6)

See original GitHub issue

The <select> element is initialized with materialize_select function and transformed to <input> with readonly="true" attribute. When clicked on iPhone6, the text in this element can’t be edited but there is displayed a cursor.

I think it may be caused by readonly="true" syntax instead of readonly, readonly="" or readonly="readonly" suggested by W3C. Is there any reason other than readability to choose readonly="true" above any of them?

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

10reactions
TimGrcommented, Aug 26, 2016

user-select: none; fixed it for me in Safari

0reactions
pwill2commented, Sep 18, 2017

@Dogfalo Was this ever fixed for the disabled attribute? I have a select dropdown that I need to toggle the disabled attribute on with two buttons.

<div class="input-field col s8">
    <select disabled id="questionType">
        <option value="" disabled selected>Choose the question type</option>
        <option value="CheckboxQuestion">Checkbox Question</option>
        <option value="MultipleChoiceQuestion">Multiple Choice Question</option>
        <option value="RegionQuestion">Region Question</option>
        <option value="SelectQuestion">Select Question</option>
        <option value="SliderQuestion">Slider Question</option>
        <option value="TextQuestion">Text Question</option>
        <option value="YesNoQuestion">Yes-No Question</option>
    </select>
    <label for="questionType">type</label>
</div>
Read more comments on GitHub >

github_iconTop Results From Across the Web

On Safari Mobile, auto-select all the text of a read-only input ...
The problem arises with Safari Mobile (I'm using iOS 7.0.6). From what I can tell, the read-only prevents using the standard setSelectionRange(0 ...
Read more >
Safari Technology Preview Release Notes - Apple Developer
Fixed selecting timeline records from a coalesced record bar selecting the first record in the group, not the record nearest the cursor. (254056@main)....
Read more >
Annoying iOS Safari input issues with workarounds
While setting a form input read-only should prevent the virtual keyboard (or other native controls, like a datepicker) from opening, there are ...
Read more >
HTML Standard - GitHub Pages
If the select element's display size is 1, and no option elements in the select ... at the select element, with the bubbles...
Read more >
4.10.5 The input element - HTML Standard - whatwg
An input element's dirty value flag must be set to true whenever the user ... attribute and false if it does not, empty...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found