nrkno / core-components

Accessible and lightweight Javascript components
https://static.nrk.no/core-components/latest/
MIT License
117 stars 10 forks source link

Typeerror i core-suggest #658

Closed TatyanaLo closed 2 years ago

TatyanaLo commented 2 years ago

Ved bruk av core-suggest v. 1.3.3. Screenshot 2022-09-15 at 16 25 49

TatyanaLo commented 2 years ago

Screenshot 2022-09-15 at 16 31 14

skjalgepalg commented 2 years ago

Hi, thanks for the heads-up! Could you provide an example of your implementation so I can reproduce this?

TatyanaLo commented 2 years ago

søker helt fint mens man skriver, men etter at man har valgt fra listen blir value undefined.

<Input
        label="Finn"
        defaultValue={value?.display || ""}
        onChange={updateInput}
        list="id"
      />
<CoreSuggest
        id="id"
        highlight="off"
        onSuggestSelect={(event: CustomEvent<HTMLElement>) => {
          const value = event.detail.getAttribute("data-value");
          onChange(...);
        }}
      >
        {codingList.length > 0 ? (
          <ul>
            {codingList.map((coding) => (
              <li key={coding.code}>
                <button data-value={coding.code}>...</button>
              </li>
            ))}
          </ul>
        ) : null}
skjalgepalg commented 2 years ago

@TatyanaLo could you please verify if the problem persists in version @nrk/core-suggest@1.3.4-0?

npm i -E @nrk/core-suggest@1.3.4-0

TatyanaLo commented 2 years ago

Fixed!

skjalgepalg commented 2 years ago

Merged fix and published patch @nrk/core-suggest@1.3.4 to npm from master