fix(files): trim names on new node creation#47147
Conversation
|
/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
| // 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.
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.
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.
sure, thats why I am asking. This PR only touches the new name handling so should be fine.
Fix #46401