Skip to content
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

Udskift querySelector med getElementById i dropdown.js #220

Closed
chce opened this issue Sep 29, 2023 · 2 comments
Closed

Udskift querySelector med getElementById i dropdown.js #220

chce opened this issue Sep 29, 2023 · 2 comments

Comments

@chce
Copy link

chce commented Sep 29, 2023

[Indmeld kun 1 fejl pr. issue og tjek gerne om fejlen allerede er indmeldt. (Only one bug per issue and make sure to check if the issue already exists)]

Bekskriv fejlen (Describe the bug)
https://github.com/detfaellesdesignsystem/dkfds-components/blob/master/src/js/components/dropdown.js
Linje 146:
let targetEl = currentOverflowMenuEL.querySelector('#'+triggerEl.getAttribute(TARGET).replace('#', ''));

Denne funktion vil fejle på et gyldigt ID, hvis det gyldige ID indeholder kolon jf. HTML Living Standard https://html.spec.whatwg.org/multipage/dom.html#global-attributes:the-id-attribute-2
querySelector anvender kolon til at differentiere pseudoelementer, og funktionen vil fejle med beskeden: DOMException: "Failed to execute 'querySelector' on 'Document': '#of:r4:' is not a valid selector.".

Genskab fejlen (To Reproduce)
Sådan genskabes fejlen (Steps to reproduce the behavior):
Se fejlbeskrivelse

Sådan burde det fungere (Expected behavior)
Man kan i stedet bruge document.getElementById, som korrekt vil finde elementet.

Desktop - udfyld venligst følgende (please complete the following information):

  • OS: Alle
  • Browser [e.g. chrome, safari]: Alle
  • Version [e.g. 22]: Nyeste

Supplerende oplysninger (Additional context)
https://bugzilla.mozilla.org/show_bug.cgi?id=883044

@detfaellesdesignsystem
Copy link
Owner

Hej @chce

Tak for din henvendelse!

Vi har oprettet en sag på det.

Med venlig hilsen
Helle Juhl
Det Fælles Designsystem

@detfaellesdesignsystem
Copy link
Owner

Hej @chce

Fejlen er løst i version 9.1.0.

Med venlig hilsen
Helle Juhl
Det Fælles Designsystem

@chce chce closed this as completed Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants