What is the goal of this task?
- I have developed a custom Menu in my application with 8 options.
- There is a need to dynamically disable certain menu options based on specific conditions (e.g. disabling the last 4 options).
- When a user hovers over a disabled option, a popup should appear to explain why that particular option is disabled.
Challenges:
- Since the number of menu options is variable, the menu must be scrollable to accommodate additional options, if needed.
- The popup displayed when hovering over a disabled option may overflow beyond the boundaries of the menu.
- This issue stems from the fact that having both
overflow-x: visible
andoverflow-y: auto
is not supported according to specifications. - Some solutions online suggest using absolute positioning to overcome this limitation, but it has not proven effective in this case.
Additional Resources:
- How do I enable scrolling only in one direction in CSS?
- Break out of overflow:hidden
- CSS overflow-x: visible; and overflow-y: hidden; causing scrollbar issue
I attempted to replicate the issue with a dummy custom menu: https://codepen.io/adiltan/pen/BaJJzOb
Although I tried implementing absolute positioning, I was unsuccessful in resolving the problem.