🐛 Kan avslutte popup-overlay-vinduet ved å hindre DOM bubbling

https://stackoverflow.com/questions/1369035/how-do-i-prevent-a-parents-onclick-event-from-firing-when-a-child-anchor-is-cli
This commit is contained in:
Markus Johansen 2023-07-28 17:22:47 +02:00
parent 5200e1c9c6
commit 80b1dfecf0

View file

@ -46,7 +46,9 @@ export const FeilCard = (props: IFeilmelding) => {
bg-bg-default border border-border-default p-7 rounded-lg bg-bg-default border border-border-default p-7 rounded-lg
h-1/2 w-1/2 h-1/2 w-1/2
"> ">
<Button onClick={() => { <Button onClick={(e) => {
//hindrer DOM bubbling https://stackoverflow.com/questions/1369035/how-do-i-prevent-a-parents-onclick-event-from-firing-when-a-child-anchor-is-cli
e.stopPropagation()
setVisFeilinformasjon(false) setVisFeilinformasjon(false)
}}> }}>
Avslutt kortvisning Avslutt kortvisning