Page MenuHomePhabricator

Right click to delete across paragraphs in Firefox results in no model transaction
Open, Needs TriagePublic

Description

Right click to delete across paragraphs in Firefox results in no model transaction. This in turn results in model corruption and inconsistent behavior.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

@dchan Do you have a MutationObserver task we can link this to?

Deleted text is supported by resolving T230325 . Deleted DOM nodes need T230323 (which does not fix deleted text).

Steps to reproduce:

  1. In VE standalone in Firefox, edit <p>abc</p><p>def</p> .
  2. Select from c to f inclusive, with the selection focus after f.
  3. Right-click on the selection, and choose Delete.

Behaviour in master:

  • In the DOM, the 'c' is deleted, as is the <p>def</p>. However, in the model, nothing is deleted.

Behaviour with T230325 resolved (i.e. https://gerrit.wikimedia.org/r/759510 ):

  • In the DOM, the 'c' is deleted, as is the <p>def</p>. In the model, the 'c' is deleted, but the <p>def</p> is not.

Change #1020858 had a related patch set uploaded (by Esanders; author: Esanders):

[VisualEditor/VisualEditor@master] Handle right-click-delete in Firefox programmatically

https://gerrit.wikimedia.org/r/1020858

We should continue with the patches to use MutationObserver, but we can also just intercept the deleteContentBackward input event when there is a selection, and execute the delete action.