mirror of
https://github.com/google/blockly.git
synced 2026-01-07 00:50:27 +01:00
Update utils.js
There is no global "getSelection()" function, see: https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection
This commit is contained in:
@@ -349,10 +349,10 @@ Blockly.createSvgElement = function(name, attrs, parent, opt_workspace) {
|
||||
* Deselect this text, so that it doesn't mess up any subsequent drag.
|
||||
*/
|
||||
Blockly.removeAllRanges = function() {
|
||||
if (getSelection()) {
|
||||
if (window.getSelection) {
|
||||
setTimeout(function() {
|
||||
try {
|
||||
var selection = getSelection();
|
||||
var selection = window.getSelection();
|
||||
if (!selection.isCollapsed) {
|
||||
selection.removeAllRanges();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user