TitleSearchWidget: Only update results if the query is current
authorDavid Lynch <dlynch@wikimedia.org>
Tue, 10 Nov 2015 23:59:27 +0000 (15:59 -0800)
committerDavid Lynch <dlynch@wikimedia.org>
Wed, 11 Nov 2015 01:31:35 +0000 (17:31 -0800)
commit4b3ecbcbc93887658768616962af5d427915ccdd
tree81af17c889ee77627b5a3e4bbb36793909c2f812
parent0de51cf62368af565104015c1afa308adaee9f3f
TitleSearchWidget: Only update results if the query is current

With near-simultaneous inputs (e.g. holding down the backspace key
while deleting text) you can cause the suggestion promise to resolve
out-of-order. This causes apparently incorrect suggestions to be
displayed for the current input.

To fix this, abort the existing promise if it exists.

Bug: T114178
Change-Id: I9332452fd914b54e7c564284da2a8a00865ae806
resources/src/mediawiki.widgets/mw.widgets.TitleSearchWidget.js