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](https://private-user-images.githubusercontent.com/32634525/304148583-6c5d5642-ee3b-45ce-917e-3f2285168dc0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA1NzM5MjIsIm5iZiI6MTcyMDU3MzYyMiwicGF0aCI6Ii8zMjYzNDUyNS8zMDQxNDg1ODMtNmM1ZDU2NDItZWUzYi00NWNlLTkxN2UtM2YyMjg1MTY4ZGMwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzEwVDAxMDcwMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNjMTg3MTBkN2Y1Y2QxNTU2Yzc1Y2NhZmE5ZjYxNzNhNGIyYWIyMGFhODU1YmI3MmExNTVlYjNjYjg3ZDU2ZWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.YGnPsJtIfPz2zktSQKDtdUyR7jYfXSoW5G3A6b1Lzmo)
For now the dropdown item doesn't have any class that indicates that the submenu was opened
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
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