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

Deleting text in element resets its styles #1774

Closed
dreamofabear opened this issue May 14, 2020 · 10 comments · Fixed by #2584
Closed

Deleting text in element resets its styles #1774

dreamofabear opened this issue May 14, 2020 · 10 comments · Fixed by #2584
Labels
Elements: Text P1 High priority, must do soon Type: Bug Something isn't working

Comments

@dreamofabear
Copy link
Contributor

dreamofabear commented May 14, 2020

Bug Description

Deleting all the text in a label resets font color, weight and italic/underline (and perhaps others too).

Steps to Reproduce

  1. Create a text element and set font color, weight or italic/underline.
  2. Edit the text and press backspace until all the text is deleted.
  3. Type some new text.

Expected: The new text is styled with the same style as the deleted text.
Actual: The new text is not styled.

Screenshots

text_bug


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance Criteria

QA Instructions

Replace text without clearing

  1. Add a text element to a page
  2. Apply styling to the text element in the form of font-weight, italics, underline, letter-spacing or color (all styles that can be applied per-character).
  3. Then enter edit mode
  4. Select all the text
  5. Start typing (will clear old content) and observe new characters still being the same style, as the text had before.

Clear by selecting all and replacing

  1. Add a text element to a page
  2. Apply styling to the text element in the form of font-weight, italics, underline, letter-spacing or color (all styles that can be applied per-character).
  3. Then enter edit mode
  4. Clear the text field by selecting all the text and pressing backspace
  5. Start typing and observe new characters still being the same style, as the text had before.

Clear by deleting characters one at a time

  1. Add a text element to a page
  2. Apply styling to the text element in the form of font-weight, italics, underline, letter-spacing or color (all styles that can be applied per-character).
  3. Then enter edit mode
  4. Clear the text field by placing the cursor at the end and pressing backspace until the input is empty
  5. Start typing and observe new characters still being the same style, as the text had before.

NB: If you have multiple styles in the text field before clearing (e.g. some text bold, some text not bold), the new text styling should follow that of the first character in the input field (but there might be some variations here depending on where the cursor is before clearing and how you clear it). This part is not essential for this ticket, and any discovered inconsistencies should be noted as a follow-up issue.

@dreamofabear dreamofabear changed the title Deleting text in a label resets styles Deleting text in a label resets its styles May 14, 2020
@swissspidy swissspidy changed the title Deleting text in a label resets its styles Deleting text in element resets its styles May 14, 2020
@swissspidy swissspidy added Elements: Text Type: Bug Something isn't working labels May 14, 2020
@swissspidy
Copy link
Collaborator

How could I "clear" the formatting in this case without having to reset each setting manually in the design panel? Press backspace again? Might need some UX definition here.

@dreamofabear
Copy link
Contributor Author

dreamofabear commented May 14, 2020

Following precedence from text editors, that's usually done with a separate "clear formatting" action. Command+\ in Docs for example.

Minimally, we should avoid losing the style IMO. Users can always unset styles individually.

@jauyong jauyong removed their assignment May 21, 2020
@barklund barklund added this to the Sprint 31 milestone Jun 11, 2020
@jauyong
Copy link

jauyong commented Jun 11, 2020

Just tagging @samitron7 for awareness on this one.

@csossi
Copy link

csossi commented Jun 19, 2020

Tested in QA - PR#2584

See QA Testing Instructions above

1st scenario is fine now, but 2nd and 3rd are still having the same prob

@barklund
Copy link
Contributor

@csossi, can I get you to re-test this making sure you're on the right branch? I'm seeing all scenarios work as expected here. Scenario 1 probably worked even before this branch, thus you might be on an unrelated to see this result.

@barklund
Copy link
Contributor

@csossi it seems there was a temporary problem with Pantheon caching an old version of the branch. But when I re-applied the branch from the dropdown, it worked fine.

You can validate, that you're on the right version of the branch, if you see the safe zone tick marks (rather than the old danger zone marking).

Can you please re-evaluate this issue with that in mind?

@csossi
Copy link

csossi commented Jun 19, 2020

Verified in QA

@barklund barklund reopened this Jun 19, 2020
@barklund barklund removed their assignment Jun 22, 2020
@samitron7
Copy link

samitron7 commented Jun 26, 2020

All 3 use cases passed but the following one (which is not a part of this QA failed)

  1. Add new text field and style
  2. Add a new line then select all and type. (Or just add new line and type). All the styles are wiped out.

@barklund Should I move this to done and we get a new ticket filed?

@swissspidy
Copy link
Collaborator

Should I move this to done and we get a new ticket filed?

Yes. Every time a ticket does not fully pass UAT, a new issue should be created to address the remaining issues.

@samitron7
Copy link

Moved to done but filed a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Elements: Text P1 High priority, must do soon Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants