devbookhq / splitter

React component for building split views like in VS Code
https://usedevbook.com
MIT License
440 stars 30 forks source link

Keyboard support #1

Open joshwcomeau opened 3 years ago

joshwcomeau commented 3 years ago

As far as I can tell, the panels can only be resized by using a pointer device, like a mouse. It would be awesome if the panels could also be resized using a keyboard!

I imagine that the dividers could be buttons instead of divs, and when focused, the arrow keys could resize the panels (maybe it could jump in increments of 10px at a time, to make it a bit less tedious).

I'm excited about this project and I'd be happy to promote it, if it was a bit more accessible!

Thanks for open-sourcing your work 😄

mlejva commented 3 years ago

Support for the keyboard is actually planned! We're using Splitter in the next version of Devbook and we want almost everything to be controllable using a keyboard. Eventually, we will add it to Splitter.

When you say if it was a bit more accessible do you have something else on your mind besides the keyboard use-case you described?

joshwcomeau commented 3 years ago

Awesome 😄 Thrilled to hear it! Thanks for the quick reply.

And nope — the keyboard stuff I mentioned is the only accessibility issue I'm aware of (though I'm definitely not an expert).

martonlanga commented 3 years ago

This could also be achieved by having a controlled Splitter and changing the tile sizes manually when the correct keyboard shortcut is pressed.