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!: Redundant blockly non selectable #8328 #8433

Merged
12 changes: 6 additions & 6 deletions core/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,6 @@ let content = `
touch-action: none;
}

.blocklyNonSelectable {
user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
}

.blocklyBlockCanvas.blocklyCanvasTransitioning,
.blocklyBubbleCanvas.blocklyCanvasTransitioning {
transition: transform .5s;
Expand Down Expand Up @@ -430,6 +424,9 @@ input[type=number] {
}

.blocklyWidgetDiv .blocklyMenu {
user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
background: #fff;
border: 1px solid transparent;
box-shadow: 0 0 3px 1px rgba(0,0,0,.3);
Expand All @@ -449,6 +446,9 @@ input[type=number] {
}

.blocklyDropDownDiv .blocklyMenu {
user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
background: inherit; /* Compatibility with gapi, reset from goog-menu */
border: inherit; /* Compatibility with gapi, reset from goog-menu */
font: normal 13px "Helvetica Neue", Helvetica, sans-serif;
Expand Down
3 changes: 2 additions & 1 deletion core/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ export class Menu {
* @param container Element upon which to append this menu.
* @returns The menu's root DOM element.
*/

render(container: Element): HTMLDivElement {
const element = document.createElement('div');
element.className = 'blocklyMenu blocklyNonSelectable';
element.className = 'blocklyMenu';
element.tabIndex = 0;
if (this.roleName) {
aria.setRole(element, this.roleName);
Expand Down
4 changes: 3 additions & 1 deletion core/toolbox/toolbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,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 Expand Up @@ -1104,6 +1103,9 @@ Css.register(`

/* Category tree in Toolbox. */
.blocklyToolboxDiv {
user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
background-color: #ddd;
overflow-x: visible;
overflow-y: auto;
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
Loading