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

fix: Fix bug that caused text to be selected when long-pressing in the workspace on a touch device. #8670

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions core/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ let content = `
position: relative;
overflow: hidden; /* So blocks in drag surface disappear at edges */
touch-action: none;
user-select: none;
-webkit-user-select: none;
}

.blocklyNonSelectable {
Expand Down Expand Up @@ -266,17 +268,6 @@ let content = `
cursor: default;
}

/*
Don't allow users to select text. It gets annoying when trying to
drag a block and selected text moves instead.
*/
.blocklySvg text {
user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
cursor: inherit;
}

.blocklyHidden {
display: none;
}
Expand Down
1 change: 0 additions & 1 deletion core/toolbox/toolbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ export class Toolbox
const toolboxContainer = document.createElement('div');
toolboxContainer.setAttribute('layout', this.isHorizontal() ? 'h' : 'v');
dom.addClass(toolboxContainer, 'blocklyToolboxDiv');
dom.addClass(toolboxContainer, 'blocklyNonSelectable');
toolboxContainer.setAttribute('dir', this.RTL ? 'RTL' : 'LTR');
return toolboxContainer;
}
Expand Down
5 changes: 1 addition & 4 deletions tests/mocha/toolbox_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ suite('Toolbox', function () {
test('Init called -> HtmlDiv is inserted before parent node', function () {
const toolboxDiv = Blockly.common.getMainWorkspace().getInjectionDiv()
.childNodes[0];
assert.equal(
toolboxDiv.className,
'blocklyToolboxDiv blocklyNonSelectable',
);
assert.equal(toolboxDiv.className, 'blocklyToolboxDiv');
});
test('Init called -> Toolbox is subscribed to background and foreground colour', function () {
const themeManager = this.toolbox.workspace_.getThemeManager();
Expand Down