material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[Popover] Fix the scrolling issue when a Popover is inside an iframe

Open michaldudak opened this issue 3 years ago • 2 comments

This is a partial fix of a problem described in #27584. With this fix, the page doesn't scroll to the top of the iframe, but it centers the Select in the viewport. It's not a perfect solution but it does improve the UX.

michaldudak avatar Jul 08 '22 16:07 michaldudak

Details of bundle changes

Generated by :no_entry_sign: dangerJS against 011091b0393e1fdeb5eafb5e3599119d4813fd04

mui-bot avatar Jul 08 '22 16:07 mui-bot

I managed to solve it as follows:

SelectProps={{ MenuProps:{ autoFocus: false, disableAutoFocusItem: true, disableEnforceFocus: true, disableAutoFocus: true, } }}

guilhermeabell avatar Jul 26 '22 18:07 guilhermeabell

@michaldudak can you prepare a codesandbox to show that this works? I tried the package from the latest commit in https://codesandbox.io/s/naughty-haibt-jr5gq3?file=/package.json (see https://jr5gq3.csb.app/iframe.html), but the issue is the same.

mnajdova avatar Oct 10 '22 11:10 mnajdova

I may have done something differently when testing this locally. It doesn't work on codesandbox indeed.

michaldudak avatar Oct 28 '22 12:10 michaldudak

@mnajdova

I managed to solve it as follows:

SelectProps={{ MenuProps:{ autoFocus: false, disableAutoFocusItem: true, disableEnforceFocus: true, disableAutoFocus: true, } }}

guilhermeabell avatar Feb 01 '24 22:02 guilhermeabell