Open gked opened 6 years ago
@gked I think the events should fire under all circumstances. Whether or not there actually is something to cut must be up to the JavaScript app to determine. The JavaScript app may for example have defined it's own selection system for table cells/rows/columns. So while the browser's text selection could be empty, the app may by the means of styling of table cells have selected specific table cells and then delete those in case of user interaction indicating deletion.
The alternative will just be even more tricks in the JavaScript, where one constantly needs to make sure that the selection is not empty in case of presenting a different selection mechanism.
I was trying to make an html editor and found out this issue, which.. consumed so much time of mine. I think the event should be triggered whatever input type'd be fired up from the input, as it's name, 'before-input'.
Hi, I have came across the issue where deleteByCut and deleteContentBackward input types are not firing consistently in Chrome and Safari in cases when target node is empty (in the sense that there is no text to be removed). There maybe other events as well.
Currently, Chrome deleteByCut - event is not firing deleteContentBackward - event is firing
Safari deleteByCut - event is not firing deleteContentBackward - event is not firing
Should we generalize this somehow? Should we always fire beforeInput events, regardless of whether there is content to be affected or not?