BookStack icon indicating copy to clipboard operation
BookStack copied to clipboard

Can't dismiss callout

Open SonGokussj4 opened this issue 3 years ago • 1 comments

Describe the Bug

When I write something into callout and it's the last line in book (I don't have any paragraphs or text under) and press Enter, new line with new callout appears. If I press Backspace, it disappears but the cursor goes to the previous callout.

Right now when:

  • I press enter, it will create a new callout,
  • I press ctrl+1 to change it to H1, it will create H1 inside callout,
  • then I press ctrl+1 again and it will convert H1 inside callout into simple paragraph

Expected behavior:

  • Like in Notion, (when I press enter in callout, next line is a normal paragraph)

Steps to Reproduce

As written above

Expected Behaviour

As written above

Screenshots or Additional Context

No response

Browser Details

Chrome 105.0.5195.102

Exact BookStack Version

v22.07.03

PHP Version

No response

Hosting Environment

Docker / Docker-compose

SonGokussj4 avatar Sep 07 '22 13:09 SonGokussj4

Hi. The similar is happening with inline_code.

  • CTRL+8 (to activate inline code)
  • write some text
  • enter

New line is starting as inline code. Normal <p> would be preferred.

Wrong way to dismiss:

  • after pressing enter, press backspace - because that would just move the cursor line above inside the previous inline_code with an empty inline_code block on the right.

Funny enough, if I repeat enter and backspace a few times, this happens: image

Correct way to dismiss:

  • after pressing enter, write any character and only then press backspace - that will dismiss the inline_code block and I can write normally.

SonGokussj4 avatar Sep 08 '22 07:09 SonGokussj4

Dev findings for callouts

Setting tinymce keep_styles option to false will clear on newline, but will affect current format handling in such cases for all block types. Option usage in tinymce src here:

https://github.com/tinymce/tinymce/blob/f65c926ace4ae3f68f8c08a1f6a4b693fc26e241/modules/tinymce/src/core/main/ts/newline/InsertBlock.ts#L267-L270

No additional control possible by the looks of things via specific format. Can possibly hook into custom event to handle specific cases we're attempting to address:

https://github.com/tinymce/tinymce/blob/f65c926ace4ae3f68f8c08a1f6a4b693fc26e241/modules/tinymce/src/core/main/ts/newline/InsertBlock.ts#L497

ssddanbrown avatar Sep 23 '22 11:09 ssddanbrown

I have a document ending with a callout and I don't know how to dismiss it. I've tried using the arrow keys, clicking around, enter and backspace. I can't find any way to continue editing the document outside of the callout.

rgkirch avatar Mar 17 '23 18:03 rgkirch

Is there a workaround?

rgkirch avatar Mar 17 '23 18:03 rgkirch

Oh, I can make a new empty one and then toggle "large header" on and off.

rgkirch avatar Mar 17 '23 18:03 rgkirch