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

Unable to drag Plotly js rangeslider inside Dialog #3222

Open
Lexachoc opened this issue Nov 11, 2024 · 1 comment
Open

Unable to drag Plotly js rangeslider inside Dialog #3222

Lexachoc opened this issue Nov 11, 2024 · 1 comment

Comments

@Lexachoc
Copy link

Lexachoc commented Nov 11, 2024

Bug report

Current Behavior

When putting the Plotly js plot inside the Dialog, the draggable rangeslider of Plotly plot is unable to use.

I guess this is a bug from Dialog, as the plot works fine without Dialog. But I'm not 100% sure.

It will throw the following error when trying to drag the rangeslider

Uncaught TypeError: Cannot set properties of undefined (setting '_guiEditing')

I suspect that react-remove-scroll might be the reason why the drag event of the plotly library (d3) does not work.

When using <Dialog.Root modal={false}>, the range slider is working as expected.

Expected behavior

I expect the draggable rangeslider will work when inside the Dialog.

Reproducible example

The plot outside the Dialog is fine, both the range slider and the plot can be dragged. But the range slider of the plot inside the Dialog cannot be dragged and causes an error (from Plotly).

The style="pointer-events: none;" on body is not allowing me to drag the rangeslider inside the Dialog.

https://codesandbox.io/p/sandbox/plotly-inside-dialog-7vlg2r

PixPin_2024-11-11_01-12-16

Your environment

Software Name(s) Version
Radix Package(s) radix-ui/react-dialog 1.1.2
React n/a 18.3.1
Browser Chrome 130.0.6723.117 (Official Build) (64-bit)
Assistive tech n/a n/a
Node n/a n/a
npm/yarn n/a n/a
Operating System Windows 10 Pro 22H2
@Lexachoc
Copy link
Author

As a workaround, I set the Dialog with modal={false} and use a custom Overlay (implement the react-remove-scroll on my own) to simulate the same effect of modal={true}. So it will not add the style="pointer-events: none;" on body which can allow the rangeslider to be dragged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant