Item box: Populate both fields on creator autocomplete click

Fixes #3129
This commit is contained in:
Abe Jellinek 2023-05-23 19:06:56 +03:00
parent 04a44cfbaa
commit 61749d39a6

View file

@ -1578,12 +1578,15 @@
params.creatorTypeID = creatorTypeID;
}
// Return
t.addEventListener('keydown', (event) => {
if (event.key == 'Enter') {
this.handleCreatorAutoCompleteSelect(t, true);
}
});
// Return/click
// Monkey-patching onTextEntered is apparently the current official way to detect completion --
// there's also a custom event called textEntered, but it won't be fired unless the input has its
// 'notifylegacyevents' attribute set to true
// https://searchfox.org/mozilla-central/source/toolkit/content/widgets/autocomplete-input.js#372
// https://searchfox.org/mozilla-central/rev/2d678a843ceab81e43f7ffb83212197dc10e944a/browser/components/search/content/searchbar.js#791
t.onTextEntered = () => {
this.handleCreatorAutoCompleteSelect(t, true);
};
// Tab/Shift-Tab
t.addEventListener('change', () => {
this.handleCreatorAutoCompleteSelect(t, true);