-
Notifications
You must be signed in to change notification settings - Fork 955
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
On Edge/IE11 input is stamping the expression placeholder as the value #375
Comments
const tpl = document.createElement('template');
tpl.innerHTML = '<input value="foo">';
const input = document.importNode(tpl.content, true).firstElementChild;
input.removeAttribute('value');
console.log('value is now:');
console.log(JSON.stringify(input.value)); This logs the value as Setting the Repro in @notwaldorf's example: https://stackblitz.com/edit/lit-element-example-sqqeig. Note how the setter never gets called unless you uncomment the Another result of the fact that import {render, html} from 'lit-html';
render(html`
<div test="${undefined} is ${undefined}"></div>
`, document.body);
console.log(document.body.innerHTML); logs
Repro: https://stackblitz.com/edit/lit-element-example-fqhsbb |
For initial renders, _equalToPreviousValues must always return false. The other checks will return true if all values in the part are undefined, meaning attributes can get lost. See lit#375
Make `AttributePart#_equalToPreviousValues` always return false in the initial render For initial renders, _equalToPreviousValues must always return false. The other checks will return true if all values in the part are undefined, meaning attributes can get lost. See #375
Make `AttributePart#_equalToPreviousValues` always return false in the initial render For initial renders, _equalToPreviousValues must always return false. The other checks will return true if all values in the part are undefined, meaning attributes can get lost. See lit#375
In a

LitElement
, if you are using an<input value="${props._value}">
in your template andprops._value
isundefined
, then Edge/IE stamp the expression placeholder instead of something good:If you set a default value for
_value
in the element's constructor then it's fine.Repro: https://lit-element-example-6nhwjs.stackblitz.io
(Works fine on Chrome/FF/Safari, borked on Edge/IE11)
The text was updated successfully, but these errors were encountered: