fix: fixes issue 1483

replaced `getElementById` with `querySelector` so correct element  is also selected when size = inline
This commit is contained in:
Danny Moerkerke 2022-05-03 11:39:36 +02:00
parent b291e60794
commit 23d4d0014d

View file

@ -188,7 +188,7 @@ export const checkedIndexAndValue = ({ shadowRoot }) => html`
aria-labelledby="label-richSelectCheckedInput"
type="number"
@change=${e => {
const selectEl = shadowRoot.getElementById('checkedRichSelect');
const selectEl = shadowRoot.querySelector('#checkedRichSelect');
selectEl.checkedIndex = e.target.value;
}}
/>
@ -196,7 +196,7 @@ export const checkedIndexAndValue = ({ shadowRoot }) => html`
<button
class="log-button"
@click=${() => {
const selectEl = shadowRoot.getElementById('checkedRichSelect');
const selectEl = shadowRoot.querySelector('#checkedRichSelect');
console.log(`checkedIndex: ${selectEl.checkedIndex}`);
console.log(`checkedValue: ${selectEl.checkedValue}`);
}}