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.

input readonly list-attribute

See original GitHub issue

Fails in rendering an input with attribute ‘list’ user for targeting datalist-element Removing the attribute renders both input and datalist elements, then unconnected and useless of course.

Console message: Cannot assign to read only property ‘list’ of object ‘#<HTMLInputElement>’ at setElementData…

Reproduced in glitch https://glitch.com/edit/#!/wry-autocomplete

import { h, app } from 'hyperapp' // 0.7.1
// import {h, app} from '../hyperapp/index' // 0.8.0, unreleased


const dataList = () =>
  <datalist id='browsers'>
    <option value='Chrome'></option>
    <option value='Firefox'></option>
    <option value='Internet Explorer'></option>
    <option value='Opera'></option>
    <option value='Safari'></option>
    <option value='Microsoft Edge'></option>
  </datalist>

const view = () =>
  <div class='container'>
    <label>Choose a browser from this list:
    <input list='browsers' /></label>
    {dataList()}
  </div>            

app({view})

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
marcusasplundcommented, Apr 15, 2017

Yup. I can confirm that it works as expected now. Good work! Updated to 0.8.1 https://glitch.com/edit/#!/wry-autocomplete (Heads up: Glitch is a bit quirky/slow for me atm)

1reaction
jorgebucarancommented, Apr 15, 2017

@marcusasplund I think this is fixed in >=0.8.1. Can you give it a shot? 🙏

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTML input readonly Attribute - W3Schools
The readonly attribute is a boolean attribute. When present, it specifies that an input field is read-only. A read-only input field cannot be...
Read more >
<input>: The Input (Form Input) element - HTML
The <input> HTML element is used to create interactive controls for web-based forms in order to accept data from the user; a wide...
Read more >
input type=file – file upload control - HTML5
The input element with a type attribute whose value is " file " represents a list of file ... readonly attribute HTMLElement list;...
Read more >
allow aria-readonly on input type=text with role=combobox #324
You can see that I had aria-readonly on the input, but this raised the validation error as I wasn't using a list attribute....
Read more >
HTML Input Attributes - Dofactory
HTML input attributes -- the best examples. Specifies the initial value for an input field. ... readonly, readonly, Make input read only.
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