HomePhabricator

Fix sorting issue for tokens input with remote autocompletion

Description

Fix sorting issue for tokens input with remote autocompletion

If tokens input is configured to use remote autocompletion or
forced to use it due to $wgPageFormsMaxLocalAutocompleteValues limits
the event data on select2:select event does not contain a link
to the actual select option element, thus the "sorting fix" which
ensures elements stay in the order they were added is unable
to work correctly.

This patch fixes this by checking presence of the link at
evt.params.data.element and fetching related element from DOM
if necessary.

Change-Id: I6613633d2bdee3aa3902bd95159650a73ba41694

Details

Provenance
VedmakaAuthored on Jan 13 2022, 8:28 PM
Yaron_KorenCommitted on Jan 16 2022, 2:37 PM
Parents
rEPFM86d900793eda: Further fix for c9f609267faf - fix post-error page saves
Branches
Unknown
Tags
Unknown
ChangeId
I6613633d2bdee3aa3902bd95159650a73ba41694