Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HxGrid] Context menu causes scrollbar #118

Open
Apskaita5 opened this issue Apr 19, 2022 · 15 comments
Open

[HxGrid] Context menu causes scrollbar #118

Apskaita5 opened this issue Apr 19, 2022 · 15 comments
Assignees
Labels
bug Something isn't working waiting-bootstrap Waiting for action on Bootstrap side
Milestone

Comments

@Apskaita5
Copy link

When there are few rows in the grid and a relatively large context menu, when showing context menu it doesn't fit the table area which forces a scrollbar to appear (part of context menu hidden).

@hakenr
Copy link
Member

hakenr commented Apr 19, 2022

@crdo, can you please take a look and asses this issue? Thanx.

@crdo
Copy link
Member

crdo commented Apr 19, 2022

@Apskaita5 @hakenr yes, I have came across this issue already. @Harvey1214 please create a reproducing page for this issue in our BlazorTestApp so I can try to come up with some solution.

@crdo crdo added bug Something isn't working under investigation labels Apr 19, 2022
@Harvey1214
Copy link
Member

@crdo
Copy link
Member

crdo commented Apr 25, 2022

@Apskaita5 could you please confirm that the HxGrid instance that you refer to is responsive (IsResponsive=true)?

@crdo
Copy link
Member

crdo commented Apr 25, 2022

Anyway, what causes your issue most likely is the presence of overflow: auto | hidden; on some of the parent elements.
In this case you have two options:

  1. Get rid of the overflow
  2. Tweak the Popper config so the Dropdown (that is used internally for the HxContextMenu) behaves as close as desired https://popper.js.org/docs/v2/modifiers/prevent-overflow/

@hakenr can we set our own Popper config to the relevant HxCompoments?

@Apskaita5
Copy link
Author

@Apskaita5 could you please confirm that the HxGrid instance that you refer to is responsive (IsResponsive=true)?

Yep. (CSS table-responsive)

@Apskaita5
Copy link
Author

Anyway, what causes your issue most likely is the presence of overflow: auto | hidden; on some of the parent elements.

Only if it is present on Havit components.

@crdo
Copy link
Member

crdo commented Apr 25, 2022

Related discussion in Bootstrap repo twbs/bootstrap#33463 (comment)

@hakenr
Copy link
Member

hakenr commented Apr 25, 2022

As far as I understand, new Bootstrap release should resolve this issue with twbs/bootstrap#33684 and we don't need to do anything on our side. @crdo?

@hakenr can we set our own Popper config to the relevant HxCompoments?

Yes, we are technically able to do that, but we have to be very careful with HxContextMenu which is typically rendered repeatedly (e.g. in HxGrid) and calling JavaScript from Blazor for every single instance might cause significant performance issues.

@crdo
Copy link
Member

crdo commented Apr 25, 2022

As far as I understand, new Bootstrap release should resolve this issue with twbs/bootstrap#33684 and we don't need to do anything on our side. @crdo?

@hakenr I think that this issue has been already merged into one of the previous versions.

@hakenr
Copy link
Member

hakenr commented May 10, 2022

Already reported to Bootstrap: twbs/bootstrap#35774

@hakenr hakenr added waiting-bootstrap Waiting for action on Bootstrap side and removed under investigation labels May 10, 2022
@hakenr
Copy link
Member

hakenr commented Aug 31, 2022

Bootstrap 5.2.0 probably does not offer any suitable solution (setting boundary with data-attribute or something like that).

It is probably achievable with JavaScript options (setting boundary to body): twbs/bootstrap#36358
...but it is something we definitely do not won't for PERF reasons as the HxContextMenu is heavily used in data-list scenarios (such as HxGrid).

@crdo
Copy link
Member

crdo commented Sep 8, 2022

@hakenr
Copy link
Member

hakenr commented Sep 8, 2022

@crdo But the boundary is not string but we need to pass an element reference. Not sure how this might work with data attributes.

@hakenr hakenr added this to the Waiting milestone Jan 7, 2024
@crdo
Copy link
Member

crdo commented Apr 11, 2024

@hakenr adding data-bs-popper-config='{"strategy":"fixed"}' on the dropdown element would solve the issue. We need to decide if we want to do it with attribute splatting or some other technique.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working waiting-bootstrap Waiting for action on Bootstrap side
Projects
None yet
Development

No branches or pull requests

4 participants