fix #1505: pre-selecting first field in auto-type dropdown

This commit is contained in:
antelle 2020-12-19 16:47:37 +01:00
parent 1617cae518
commit f489eca5c2
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C
4 changed files with 8 additions and 1 deletions

View File

@ -232,7 +232,7 @@ class AutoTypeSelectView extends View {
this.highlightActive();
}
const view = new DropdownView();
const view = new DropdownView({ selectedOption: 0 });
this.listenTo(view, 'cancel', this.hideItemOptionsDropdown);
this.listenTo(view, 'select', this.itemOptionsDropdownSelect);

View File

@ -31,6 +31,8 @@ class DropdownView extends View {
this.once('remove', () => {
$('body').off('click contextmenu keydown', this.bodyClick);
});
this.selectedOption = model.selectedOption;
}
render(config) {
@ -47,6 +49,9 @@ class DropdownView extends View {
top = Math.max(0, bodyRect.bottom - ownRect.height);
}
this.$el.css({ top, left });
if (typeof this.selectedOption === 'number') {
this.renderSelectedOption();
}
}
bodyClick(e) {

View File

@ -124,6 +124,7 @@ $fa-var-inbox: next-fa-glyph();
$fa-var-save: next-fa-glyph();
$fa-var-hdd: next-fa-glyph();
$fa-var-dot-circle: next-fa-glyph();
$fa-var-user: next-fa-glyph();
$fa-var-user-lock: next-fa-glyph();
$fa-var-terminal: next-fa-glyph();
$fa-var-print: next-fa-glyph();

View File

@ -4,6 +4,7 @@ Release notes
`+` automatically switching between dark and light theme
`+` clear searchbox button
`+` favicon download improvements
`+` auto-type field selection dropdown improvements
##### v1.16.5 (2020-12-18)
`-` using custom OneDrive without a secret