mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04: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:
parent
218fdc667d
commit
d555121a1c
1 changed files with 2 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue