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

web: Sometimes text gets draggable while playing #33

Open
mmazzarolo opened this issue Nov 16, 2020 · 2 comments
Open

web: Sometimes text gets draggable while playing #33

mmazzarolo opened this issue Nov 16, 2020 · 2 comments

Comments

@mmazzarolo
Copy link
Owner

Still not sure how to consistently reproduce but the issue is definitely there (Chrome).

Example: https://imgur.com/br7refv

@mgiuca
Copy link

mgiuca commented Nov 16, 2020

Hi, I'm the Redditor who reported it. I can give a bit more context.

Chrome 86.0.4240.193 (Windows, Chrome OS, I tried both)

I can trigger reliably: Just imagine that the cells on the page are an HTML table of text, and drag a box over a number of cells. You can't see the selection, but it is selected. (Right-click on the selected area, Chrome allows you to "copy" and "search Google for" the selected numbers.) Now, drag one of the cells you already selected, and you will see the text selection drag, rather than expanding a box.

I think I actually stumbled upon a simple fix for this in devtools. You just need to set the CSS user-select property to none on the game board element. (Or on the entire page, but you may wish for the other UI text to be selectable.)

Yup: typing this in console fixes the issue completely!

document.querySelector('.r-1loqt21').style.userSelect = 'none';

Of course the proper fix is to set that style in the CSS source ('.r-1loqt21' is just the minified name) but there's a proof-of-concept fix.

@mmazzarolo
Copy link
Owner Author

Thanks!
I'm already disabling the user selection in a few places, I suppose I might be missing a component/wrapper where it should be applied to (probably on the absolutely positioned borders). I'll check 👍

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

2 participants