react-component / menu

React Menu
https://menu.react-component.now.sh/
MIT License
681 stars 245 forks source link

fix:submenu overflow popupoffset #690

Open CooperHash opened 6 months ago

CooperHash commented 6 months ago

ref: #668

background

When we set the popupOffset, we expect all submenus to have an offset from the menu item. However, when the window width is small, the menu overflows. The overflow, represented by ... as an overflow placeholder, does not have a submenu offset.

It is necessary to fix it

before fix:

https://github.com/react-component/menu/assets/73218815/851a744b-3415-4142-8fc4-777c85efb273

after fix:

https://github.com/react-component/menu/assets/73218815/b33cc2f3-e1cc-4fd0-a570-1046c6769ffd

yoyo837 commented 6 months ago

And, some new test case is needed.

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.58%. Comparing base (4ae012f) to head (57b5938).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #690 +/- ## ======================================= Coverage 99.58% 99.58% ======================================= Files 27 27 Lines 721 722 +1 Branches 196 199 +3 ======================================= + Hits 718 719 +1 Misses 3 3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

CooperHash commented 6 months ago

And, some new test case is needed.

i have no idea how to mock overflow

alekseykurylev commented 5 months ago

@zombieJ @yoyo837 When should this PR be expected in the release?

CooperHash commented 5 months ago

@zombieJ @yoyo837 When should this PR be expected in the release?

I haven't written the test yet, so you'll need to wait for me to finish writing it before they can review it.