Evertras/bubble-table

FR: ESC to immediately remove any active filtering

Closed this issue · 6 comments

I like using / to start the table filtering, but I have to enter filter edit mode, delete the filter, and press return to remove a filter.

How about supporting ESC to clear any filter?

The table movement key should/could continue to work while I still edit the filter—no need to press return to get back to table navigation mode. I can continue to alter the filter and navigate the table.

I've added #65 which should support both configurable keys to exit filtering (adding the default escape) as well as a key to clear the filter if the user is not currently typing.

The table movement key should/could continue to work while I still edit the filter—no need to press return to get back to table navigation mode. I can continue to alter the filter and navigate the table.

I'm a little more wary of this, unfortunately. The default keybind includes j/k which is a common movement key, and if the user adds any other letters then this becomes difficult. Additionally, the arrow keys for left/right affect the filter text box as well, so there's really a narrow line of keys that won't collide here. I think for now it will be better to leave it as either filtering or controlling the table navigation, but not both.

This is released as v0.11.0. Let me know if this is enough to close the issue, or if you think there's anything left that should be done.

Thanks for all the suggestions and feedback, by the way!

I will test this, and thanks for your super fast responses and implementations! I'm impressed...

Regarding the movement keys: In most cases up/down arrows are enough.

The use case is: I start filtering the list until I can spot the entry I want, and use the arrow keys to select it. Pressing the return key should close the filter entry while keeping the filter (if it's not already the case), hitting ESC should remove the filter, while keeping the marked record in view.

I've been doing some thinking about the up/down arrow pass-through to enable movement, and unfortunately I'm still wary here. There are other movement keys as well such as home and end, ctrl+f, and others that the text box actually uses, so it's a bit confusing to me to have some keys that work for table movement still (up/down) but others that do not.

Maybe as a special case configuration setting that someone could enable?

Just wanted to check if the current version solves the ESC key request. If it does, can we close this issue? I think unfortunately the up/down while filtering may remain a won't-fix for now due to the issues outlined above.

Yes, everything works great! Thanks.