Skip to content
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 clearing the label of a share #25017

Merged
merged 1 commit into from
Jan 8, 2021
Merged

Conversation

danxuliu
Copy link
Member

@danxuliu danxuliu commented Jan 7, 2021

Follow up to #21357

When the label is being edited its value is stored in newLabel, and the original label is shown only if newLabel is not set. However, as it was checked against any falsy value instead of only undefined when the label was cleared and thus it has an empty value the original label was shown instead.

How to test

  • Open Sharing tab for a file
  • Create a link share
  • Set a label in the link share
  • Place the cursor at the end of the label and clear it by pressing backspace*

Result with this pull request

The label is cleared.

Result without this pull request

After pressing the last backspace the original label appears again.

*Note that if the whole label is selected and backspace or delete are pressed then the label is cleared as expected.

@danxuliu
Copy link
Member Author

danxuliu commented Jan 7, 2021

/backport to stable20

@rullzer rullzer mentioned this pull request Jan 7, 2021
5 tasks
Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐘

@rullzer
Copy link
Member

rullzer commented Jan 8, 2021

Needs a rebase

@rullzer rullzer force-pushed the fix-clearing-the-label-of-a-share branch from 8328336 to 8df7765 Compare January 8, 2021 09:17
@rullzer
Copy link
Member

rullzer commented Jan 8, 2021

/compile amend /

When the label is being edited its value is stored in "newLabel", and
the original label is shown only if "newLabel" is not set. However, as
it was checked against any falsy value instead of only undefined when
the label was cleared and thus it has an empty value the original label
was shown instead.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>
@npmbuildbot-nextcloud npmbuildbot-nextcloud bot force-pushed the fix-clearing-the-label-of-a-share branch from 8df7765 to fb19d4a Compare January 8, 2021 09:27
@rullzer rullzer merged commit 08cc9ad into master Jan 8, 2021
@rullzer rullzer deleted the fix-clearing-the-label-of-a-share branch January 8, 2021 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants