silverbulletmd / silverbullet

The hackable notebook
https://silverbullet.md
MIT License
2.01k stars 138 forks source link

Cannot navigate with <Home>, <End> key #858

Open honnip opened 2 months ago

honnip commented 2 months ago

I often navigate pages with the home, end keys, but I've found that doesn't work in silverbullet. Pressing Home should navigate to the beginning of the page, and pressing End should do the opposite.

GiantCrocodile commented 2 months ago

I noticed a similar thing: I would like to be able to press ESC within a text field/block to edit the editing and get back to the rendered view (like cancel editing/undo your change). This would be similar to closing popups with ESC in other applications or other web apps.

Page Down button doesn't behave as expected as well.

zefhemel commented 2 months ago

These are different issues. I don't have a home or end button on my keyboard to test this, but I'd assume they'd go to the start and end of the line. This would be my expectation, they don't do that?

As to the escape key, these should close modals pretty much always. When I open the page picker and hit Esc for instance, it closes and goes back to the editor, that doesn't happen for you?

PageDown also just pages down one page in the editor for me.

honnip commented 2 months ago

Yes, PageUp and PageDown work as expected for me too. It scrolls a single page.

I don't have a home or end button on my keyboard to test this, but I'd assume they'd go to the start and end of the line. This would be my expectation, they don't do that?

I too believe that if the cursor is in the editor, it should move to the start or end of the line, but if it is not, the page view should move.

honnip commented 2 months ago

ESC works fine, but I think @GiantCrocodile means the action of removing the cursor from the editor.

GiantCrocodile commented 2 months ago

Sorry for my late reply and that the description of what I meant wasn't clear. I would like to press ESC to be able to switch from this view (edit mode): grafik

back to (rendered view/no edit mode):

grafik

Regarding Page down button: When I do it at the top of the tutorial page (like where I took the screenshots from), pressing Page Down gets me from view/read mode into the include block: where editing is active:

```include
raw: "[[!silverbullet.md/Getting Started]]"

and when I press another time Page Down, I get out of the edit view of the include block and into the view/read only mode at the bottom of the page. So somehow it works but it's behaving weird. Expected behavior would be to just scroll down without triggering any edit mode. Page Up behaves the same.

I tested this under Win11 with latest Firefox. Maybe it behaves different per OS/browser.