detfaellesdesignsystem / dkfds-components

Styling og komponenter
Other
43 stars 13 forks source link

Dropdown not closing with overflow-menu--md-no-responsive #94

Closed VictorWinberg closed 4 years ago

VictorWinberg commented 4 years ago

Describe the bug When using overflow-menu--md-no-responsive on a overflow-menu it does not close the overflow menu like I would expect. Instead you are in need to click on the dropdown again. Is this expected behaviour or not? If it is expected, why should it not close?

To Reproduce Steps to reproduce the behavior:

  1. Go to designsystem.dk/komponenter/trinindikatorer
  2. Make the browser mobile size
  3. Compare Trinindikator i overflow-menu
    1. Click the dropdown
    2. Select a trin
    3. Notice that dropdown will collapse
  4. Now test Trinindikator - responsivt i overflow-menu
    1. Click the dropdown
    2. Select a trin
    3. Notice that it does not behave the same

Screenshots

Expected Actual
image image

(left image without and right image with overflow-menu--md-no-responsive)

Additional context The issue arise from these lines of code, seen below. https://github.com/detfaellesdesignsystem/dkfds-components/blob/8cd34be95c7a40467b4adba8c325f11652f11b60/src/js/components/dropdown.js#L307-L309 However, I am not sure what this code does and effect other part of the system, other than it will stop proceeding to closing the dropdown. https://github.com/detfaellesdesignsystem/dkfds-components/blob/8cd34be95c7a40467b4adba8c325f11652f11b60/src/js/components/dropdown.js#L282-L283

detfaellesdesignsystem commented 4 years ago

Hi @VictorWinberg,

Thanks for contacting us. It is definitely an error - I'll put it in the next sprint, so a fix will be available in the next release.

Best regards, Kristina Jensen Det Fælles Designsystem