Page MenuHomePhabricator

Changing text in a TargetWidget does not enable dialog's "Apply" button (in media, gallery, reference dialog) until second keypress
Closed, ResolvedPublic

Description

Changing text in a TargetWidget does not enable dialog's "Apply" button (in media, gallery, reference dialog) until second keypress.

Event Timeline

Change 473852 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[VisualEditor/VisualEditor@master] Revert "TargetWidget: 'change' on document transact, not surface history"

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

The change I'm reverting was meant to improve this in the gallery dialog (see comments on https://gerrit.wikimedia.org/r/c/mediawiki/extensions/VisualEditor/+/471272, search for "I36e76307d"), but it breaks other dialogs. It is no longer needed for the gallery after my proposed changes in https://gerrit.wikimedia.org/r/c/mediawiki/extensions/VisualEditor/+/473840.

matmarex renamed this task from Changing text in a TargetWidget does not enable dialog's "Apply" button (in media, gallery, reference dialog) to Changing text in a TargetWidget does not enable dialog's "Apply" button (in media, gallery, reference dialog) until second keypress.Nov 15 2018, 9:36 PM
matmarex claimed this task.
matmarex edited projects, added VisualEditor (Current work); removed VisualEditor.
matmarex moved this task from Incoming to Code review on the VisualEditor (Current work) board.
matmarex updated the task description. (Show Details)

Oooh, thanks. Do we think the behaviour happens because of setTimeout subtlety? (That would instinctively be my first guess but I haven't checked).

Change 473852 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Revert "TargetWidget: 'change' on document transact, not surface history"

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

I don't know, I didn't try to investigate either.

Change 474757 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (812b2140a)

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

Change 474757 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (812b2140a)

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

I still think that was conceptually a good change. The 'history' event is "Emitted when the history stacks change, or the ability to use them changes." - that is not the same as the surface changing, as it is also emitted on surface disable/enable.

We should come up with a version of that commit that works correctly.