I am using blockly in my project. There are other modules and components in my project where blockly is not being used. Blockly is there in only one component. However, after loading the component which is using blockly, backspace and delete key in all the input box(where type is given as empty string) stops working across the application.
I found this issue #4157.
As suggested in the mentioned thread, I tried to overwrite the Blockly.utils.isTargetInput like this -
const isTargetInput = Blockly.utils.isTargetInput;
Object.defineProperty(Blockly.utils, 'isInputTarget', {
value: (e) => {
if (e.target.tagName === 'MD-TEXT-INPUT' || e.target.tagName === 'MD-SEARCH-FIELD') {
return true;
}
},
});
This did not help.
Then I tried below code
const isTargetInput = Blockly.utils.isTargetInput;
Object.defineProperty(Blockly.utils, 'isTargetInput', {
value: (e) => {
if (e.target.tagName === 'MD-TEXT-INPUT' || e.target.tagName === 'MD-SEARCH-FIELD') {
return true;
}
},
});
This fixed the backspace issue but the blockly functionality is getting disturbed, toolbox and workspace is visible but blocks are not draggable. If we click on toolbox, we can see the blocks but we are not able to drag the block to workspace. There is no error in console.
If we specify the input type in input fields( for eg , backspace is working fine for that input. But this fix we can not do in all the components due to some adverse effects,
Can some one suggest any fix which can be applied to the component which is using blockly so that this backspace issue doesn't happen in any other components/modules of the application.
Then I tried below code
const isTargetInput = Blockly.utils.isTargetInput;
Object.defineProperty(Blockly.utils, 'isTargetInput', {
value: (e) => {
if (e.target.tagName === 'MD-TEXT-INPUT' || e.target.tagName === 'MD-SEARCH-FIELD') {
return true;
}return isTargetInput;},
});This fixed the backspace issue but the blockly functionality is getting disturbed, toolbox and workspace is visible but blocks are not draggable. If we click on toolbox, we can see the blocks but we are not able to drag the block to workspace. There is no error in console.
We are using version 3.
Will updating the version fix the issue?