ScratchAddons icon indicating copy to clipboard operation
ScratchAddons copied to clipboard

Add `user-select: none` and `draggable=false` to some elements in the extension UI

Open mxmou opened this issue 1 year ago • 5 comments

Changes

Popup after pressing Ctrl+A on v1.38.2: image

After this PR: image

Longer blocks of text, such as addon descriptions on the settings page and comments in the Messaging popup, can still be selected. draggable="false" was added to all images except the screenshot on the Permissions page.

Tests

Tested on Edge and Firefox.

mxmou avatar Jun 14 '24 09:06 mxmou

I think addon names and maybe also setting names should stay selectable.

Samq64 avatar Jun 14 '24 14:06 Samq64

Is there a way to make all SVGs non-draggable by default?

Samq64 avatar Jul 23 '24 19:07 Samq64

Is there a way to make all SVGs non-draggable by default?

I don't think so - Chrome supports the non-standard CSS property -webkit-user-drag but there's no equivalent in Firefox. Inline SVGs are non-draggable by default and it's also easier to change their color in light mode, but switching to those would be more complex than adding the draggable attribute to every icon.

mxmou avatar Jul 23 '24 20:07 mxmou

Is there a way to make all SVGs non-draggable by default?

I don't think so - Chrome supports the non-standard CSS property -webkit-user-drag but there's no equivalent in Firefox. Inline SVGs are non-draggable by default and it's also easier to change their color in light mode, but switching to those would be more complex than adding the draggable attribute to every icon.

Would using inline SVGs be viable with a build step?

DNin01 avatar Jul 23 '24 22:07 DNin01

How about the version and the "Scratch Addons" name be selectable too?

hueychen27 avatar Jul 26 '24 03:07 hueychen27

@WorldLanguages Do you think this could be merged for v1.40 or v1.41? Also #4656, which has been open for over two years and there haven't been any objections.

mxmou avatar Dec 12 '24 14:12 mxmou

Could the version number in the popup header and game titles stay selectable?

Samq64 avatar Dec 12 '24 14:12 Samq64

Could the version number in the popup header and game titles stay selectable?

Being able to copy the version number can be useful, but I'm not sure about cloud game titles. Project titles in the Messaging tab have always been unselectable.

mxmou avatar Dec 13 '24 08:12 mxmou