-
Notifications
You must be signed in to change notification settings - Fork 316
fix(composer): Don't show 'No results' dropdown when To/Cc/Bcc focused, only with search term put in #12778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix(composer): Don't show 'No results' dropdown when To/Cc/Bcc focused, only with search term put in #12778
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -52,11 +52,13 @@ | |||||||||||||||||||||||||||||
| id="to" | ||||||||||||||||||||||||||||||
| ref="toLabel" | ||||||||||||||||||||||||||||||
| :model-value="selectTo" | ||||||||||||||||||||||||||||||
| class="select" | ||||||||||||||||||||||||||||||
| :options="selectableRecipients.filter(recipient => !selectTo.some(to => to.email === recipient.email))" | ||||||||||||||||||||||||||||||
| :get-option-key="(option) => option.email" | ||||||||||||||||||||||||||||||
| :taggable="true" | ||||||||||||||||||||||||||||||
| :aria-label-combobox="t('mail', 'Select recipient')" | ||||||||||||||||||||||||||||||
| :filter-by="(option, label, search) => filterOption(option, label, search, 'to')" | ||||||||||||||||||||||||||||||
| :dropdown-should-open="shouldOpenRecipientDropdown" | ||||||||||||||||||||||||||||||
|
Comment on lines
+55
to
+61
|
||||||||||||||||||||||||||||||
| class="select" | |
| :options="selectableRecipients.filter(recipient => !selectTo.some(to => to.email === recipient.email))" | |
| :get-option-key="(option) => option.email" | |
| :taggable="true" | |
| :aria-label-combobox="t('mail', 'Select recipient')" | |
| :filter-by="(option, label, search) => filterOption(option, label, search, 'to')" | |
| :dropdown-should-open="shouldOpenRecipientDropdown" | |
| :options="selectableRecipients.filter(recipient => !selectTo.some(to => to.email === recipient.email))" | |
| :get-option-key="(option) => option.email" | |
| :taggable="true" | |
| :aria-label-combobox="t('mail', 'Select recipient')" | |
| :filter-by="(option, label, search) => filterOption(option, label, search, 'to')" | |
| :dropdown-should-open="shouldOpenRecipientDropdown" | |
| :dropdown-should-open="shouldOpenRecipientDropdown" |
Copilot
AI
Apr 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
search.trim() will throw if search is ever null/undefined (component libraries sometimes use non-string sentinel values). Make this defensive by normalizing search to a string first (e.g., (search || '')), so dropdown behavior can’t crash the composer.
| return !noDrop && open && search.trim() !== '' | |
| const normalizedSearch = (search || '') | |
| return !noDrop && open && normalizedSearch.trim() !== '' |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -378,4 +378,58 @@ describe('Composer', () => { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| expect(view.vm.submitButtonTitle).toEqual('Encrypt with Mailvelope and send later Jan 1, 02:00 PM') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| it('does not open the recipient dropdown on focus without a search term', () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const view = shallowMount(Composer, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| propsData: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isFirstOpen: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| accounts: [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id: 123, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| editorMode: 'plaintext', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isUnified: false, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| aliases: [], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mocks: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $route, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| store, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| localVue, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+383
to
+400
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| expect(view.vm.shouldOpenRecipientDropdown({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| noDrop: false, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| open: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| search: '', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| })).toEqual(false) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+406
to
+408
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| })).toEqual(false) | |
| }) | |
| })).toEqual(false) | |
| expect(view.vm.shouldOpenRecipientDropdown({ | |
| noDrop: false, | |
| open: true, | |
| search: ' ', | |
| })).toEqual(false) | |
| }) | |
| it('does not open the recipient dropdown when noDrop is true', () => { | |
| const view = shallowMount(Composer, { | |
| propsData: { | |
| isFirstOpen: true, | |
| accounts: [ | |
| { | |
| id: 123, | |
| editorMode: 'plaintext', | |
| isUnified: false, | |
| aliases: [], | |
| }, | |
| ], | |
| }, | |
| mocks: { | |
| $route, | |
| }, | |
| store, | |
| localVue, | |
| }) | |
| expect(view.vm.shouldOpenRecipientDropdown({ | |
| noDrop: true, | |
| open: true, | |
| search: 'alice', | |
| })).toEqual(false) | |
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: unrelated, stray edit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep sorry for that – I initially wanted to also have the issue fixed of the subject and body jumping when the "To" field is focused vs unfocused. Will continue with that later. :)