Closed nilshoerrmann closed 1 year ago
Additional issue: when selecting a mark in the toolbar, the panel jumps to the top when scrolled. Test with long content that will expand the textarea below "the fold".
Is the top issue any different than v3?
Oh, that's a good question I will have to check. Haven't used the textarea field with toolbar in v3 for a long time.
I just checked on 3.9 and the behaviour is the same. But I'm sure this was handled differently in earlier versions (like very early v3).
I really doubt that. Looking at earlier versions e.g. 3.3 it always seems to have been a simple prepend to the cursor selection.
Maybe you're thinking of https://github.com/fabianmichael/kirby-markdown-field ?
The Markdown field is what we usually use because of the highlighting. So yes, that might well be possible. But do we agree that the textarea behaviour is a bit … surprising? 😀
Yes and no. The textarea buttons have been quite basic, so I do see that one could request the enhancement that they get smarter. But that'd also mean adding quite some more logic, which could be worth it. But it's not a simple fix or changing it back to how it once was.
In fact, with v4 the buttons get a tiny bit smarter: Where in the past wrapping **
were always just added/inserted (again and again and again with each click), they now do get removed when the current selection is already wrapped.
Added as idea: https://kirby.nolt.io/588
Will focus this issue on the jumping bug you describe in post # 2
The main issue I see it that it generates invalid Markdown which is actually the reason why we provide the buttons to editors in the first place: they are not fluent enough in Markdown to write it blindly.
But, please, feel free to consider this a feature request :+1:
Ah, just saw the Nolt entry. Thanks!
Description
When editing content in a textarea field, the toolbar creates unexpected Markdown for block elements. Think of this existing content, the pipe being the cursor:
If I select headline 3 in the toolbar, the following will be created:
Same example as before, if I click headline 1 again to unselect it and make the current line a paragraph again, the following will be created:
Expected behavior
The block level elements should alter the Markdown blocks and not thus change the marks at the very beginning of the line.
To reproduce
Your setup
Kirby Version
Kirby 4 Beta 3 on Firefox 119 (macOS Sonoma)