Keep dropdownmenu inside screen area (as happen to contextmenu) when table is into a footer

Tags: #<Tag:0x00007efc65539f18>

The dropdownmenu from column result out of screen when the table is in a footer section
See: https://jsfiddle.net/3mzaskcw/1/
The contextmenu popup correctly to the top (in v.11 not in the jsfiddle example that uses the v.8).
Is there something wrong in my layout or there is some trick I can use to solve this problem?
Tnx
image

Hi @zaglio.stefano

I tested your issue on HOT v8 and v11 and in both cases it worked the same. But it’s not a bug, this is how dropdown menu and context menu should behave.

If you are getting different result in HOT v11 please share the demo with us.

I’ve not explained myself.


The contextmenu and d.down.menu appears below the clic point (or relative cell) in the version 8.
In the version 11 the contextmenu appears above the click point.
It would be nice that even the ddownmenu do the same because in cases as mine, where the table is in the footer of page, it’s not usable.

Hi @zaglio.stefano

I’m still getting the same result in v8 and v11 - dropdown menu and context menu are always positioned below the click point. Can you check this example and show me a screenshot of how it looks like on your side?

https://jsfiddle.net/jvk6fo5d/4/

If you are not getting the same result as I do it means that there must be some other styling on your side that change its behavior.

However, there is one solution that might help you with that issue. There is a hook called afterContextMenuShow which is triggered when contextMenu option is enabled. The you should be able to use open method to reposition the menu wherever you like. Below you can find more info about it.

aftetContextMenuShow: https://handsontable.com/docs/api/hooks/#aftercontextmenushow
open: https://github.com/handsontable/handsontable/issues/8447

Thanks, I’ll give a look to open and afterContextMenuShow.

In your JSFiddle I’ve changed the height of main area so the footer section slight down. Now the contextmenu open to down if rclick on 1st row and open to up if rclick on last row.
So the conclusion is that the code of contextmenu keep in consideration the container (bottom) limit.

image