-
Notifications
You must be signed in to change notification settings - Fork 263
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
Enh/add recipient on blur #9566
Conversation
src/components/Composer.vue
Outdated
if ( | ||
(option === null || option === undefined) | ||
&& this.recipientSearchTerms[type] !== undefined | ||
&& this.recipientSearchTerms[type] !== '' | ||
) { | ||
option = {} | ||
option.email = this.recipientSearchTerms[type] | ||
option.label = this.recipientSearchTerms[type] | ||
this.recipientSearchTerms[type] = '' | ||
} |
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.
I'm not sure I understand this trick. Is this for when you leave the input when a suggestion is shown in the dropdown?
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.
Took me a while to remember what was going on here too 😅
So (option === null || option === undefined)
is needed because that function is called in two cases:
- You selected one of the suggested options from the dropdown
- You click outside the dropdown, so the recipient is added anyway
If you were to click on the dropdown without this check it would fire twice, once for the selection of the dropdown (@option:selecting
), and once for the click closing the dropdown (@search:blur
).
&& this.recipientSearchTerms[type] !== undefined
&& this.recipientSearchTerms[type] !== ''
Just normal checks
option = {}
option.email = this.recipientSearchTerms[type]
option.label = this.recipientSearchTerms[type]
Overriding the option
parameter with not the dropdown content but the string content of the search of the NcSelect
this.recipientSearchTerms[type] = ''
Resetting the string content of the search of the NcSelect
seeing as that string has already been added as a recipient
Hope this clears things up @ChristophWurst :)
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.
Tested ✅ maybe as a followup we check if the value is in email format, before adding the address
Right, do we have a specific function for that? I wasn't able to find anything but it feels like we should have a standard for that, currently I just inserted a check on the Also an issue I'm encountering is the search term being cleared even if the term wasn't added to the email list, I will investigate it further later but it's a little weird. |
I wrote a little hacky work-arround, But idk if it's really necessary. what do you think @ChristophWurst? |
|
Signed-off-by: Grigory Vodyanov <[email protected]> fixup! Apply recipient search input on blur fixup! Apply recipient search input on blur fixup! Apply recipient search input on blur Signed-off-by: Hamza Mahjoubi <[email protected]>
da88e1c
to
9764b5e
Compare
/backport to stable3.7 |
The backport to # Switch to the target branch and update it
git checkout stable3.7
git pull origin stable3.7
# Create the new backport branch
git checkout -b backport/9566/stable3.7
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 9764b5ee
# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/9566/stable3.7 Error: Failed to cherry pick commits: error: no cherry-pick or revert in progress Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports. |
Fix #9452
Adds mail recipients automatically when the NcSelect is deselected