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

Bard: Not able to delete previous line (paragraph) when using backspace preceding a fieldset #1738

Closed
okse opened this Issue Jan 20, 2018 · 7 comments

Comments

Projects
None yet
3 participants
@ghost

ghost commented Jan 20, 2018

Statamic 2.8.2:

Expected behaviour

Delete the previous line/paragraph with backspace.

Actual behaviour

Kinda hard to explain! But if I for instance create a fieldset with a quote (or paragraph) under it, and add a new paragraph/item between them, I can't delete the new line with backspace from the last item. Hopefully the gif does a better job explaining!

Bonus: When backspacing from the start of a quote, it deletes the quote AND asks if I want to delete the fieldset (without deleting the new line). In addition clicking "Cancel" in the "Are you sure?" dialog still deletes the quote. (I know the dialog is referring to the fieldset it also is trying to delete.)

Second bonus: When arrowing up from the quote under the fieldset, it skips the new line and goes to the paragraph before the fieldset. I'll stop talking now, the gif will hopefully help clarify things.

Note that I'm using backspace trying to delete the new line. Lo and behold the gif:
2018-01-20_19-30-17

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Jan 22, 2018

Nice find!

However, just so you're aware, this is (mostly) intentional. We've tried to design Bard in such a way that things flow as naturally as possible with keyboard usage.

So when you hit backspace at the start of a paragraph after a set, it will treat the set like it's the previous character in the text and attempt to delete it. (The same thing will happen if you hit delete at the end of a paragraph before a set) Similarly, using the up/down arrow keys at the start/end of a text block will go past a set to the next/previous text block.

The bug you've encountered is that "being at the start of the text block" didn't take into account empty paragraphs. That has been fixed for next release.

@ghost

This comment has been minimized.

ghost commented Jan 22, 2018

I expected the empty line to behave like an empty text line since it looks like a line break / new paragraph and behaves like an empty text line when putting the cursor there (and thus be included in the arrowing up) and not a set (and skipping it like it does now). Does that make sense?

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Jan 22, 2018

Yup makes sense. That's the part that's broken and should be fixed in the next release.

@beckysoll

This comment has been minimized.

beckysoll commented Jan 22, 2018

I've also been experiencing this issue, and would add one thing - if I have extra space at the end of a bard field, and i try to delete it by placing my cursor there and hitting delete, it acts as if i've hit the back button in my browser, and takes me to the previous page. The warning asking me if i really want to leave flashes for a second, but it goes back before i'm able to actually say that's what I wanted to do (which it's not).

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Jan 22, 2018

That's a new one I haven't heard before. Wanna open a separate issue @beckysoll ?

@beckysoll

This comment has been minimized.

beckysoll commented Jan 22, 2018

Sure thing, will do... wasn't sure if they were related.

@beckysoll

This comment has been minimized.

beckysoll commented Jan 22, 2018

Done. I discovered it's a bit more nuanced than I'd initially thought, all info here #1743

@jasonvarga jasonvarga closed this Jan 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment