gravity-ui / uikit

Home Page:https://gravity-ui.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ability to style the “parent” element of a dropdownmenu in case submenu opened

batyrshinrn opened this issue · comments

I am trying to figure out how to style the dropdown menu item that has opening submenu

image

For now the dropdown item doesn't have any class that indicates that the submenu was opened
image

As workaround I tried to use popper modifiers to apply style to popper reference, but faced that can't set handler for popper onClose event to unset the style (onClose handler is overwriting in DropDownMenuPopup, so setting onClose in popperProps has no effect).

It would be best to have some class name that would be applied to the "parent" menu item when its submenu is opened.

UXRFC-442

commented

I've come up with a PR adding a couple of classes to parent menu items as described in the PR.

Here's a demo:
https://preview.gravity-ui.com/uikit/1465/?path=/story/components-overlays-dropdownmenu--with-nested-items