-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix(files): trim names on new node creation #47147
Conversation
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.
LGTM but didnt test
/compile rebase-amend / |
/backport to stable29 |
/backport to stable28 |
Signed-off-by: skjnldsv <skjnldsv@protonmail.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
cab33ca
to
e4e12a3
Compare
@@ -118,15 +118,15 @@ function submit() { | |||
|
|||
// Reset local name on props change | |||
watch(() => props.defaultName, () => { | |||
localDefaultName.value = getUniqueName(props.defaultName, props.otherNames) | |||
localDefaultName.value = getUniqueName(props.defaultName, props.otherNames).trim() |
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.
Is this expected behavior? I understand trimEnd
because of mobile browsers that tend to add spaces on auto complete.
Having whitespace on the start is an edge case but is completely valid, meaning this will change names if you accidentally click rename on such a file
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.
Having whitespace on the start is an edge case but is completely valid
Having a white space at the end is also valid in many filesystems :)
I figured it's not about what is valid or not, but what makes most sense from a UX perspective.
And from my experience, I've yet to see someone willingly prepend or append a space in their file name 🤔
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.
sure, thats why I am asking. This PR only touches the new name handling so should be fine.
Fix #46401