KennethSundqvist/key-jump-browser-extension

Refactor the hint positioning to work with more cases

Closed this issue · 2 comments

Collect a lot of wonky edge cases before doing this.

Cases (so far):

  • Visible element with a single non-wrapping text node. (Single client rect.)
    • Position: The element or the client rect. Don't know if there is any practical difference.
  • Visible element with a single text node that wraps to multiple lines. (One client rect for each line.)
    • Position: First visible client rect. (Some lines could be scrolled out of view and the lines can have different indentation or wrap around a shape.)
  • Collapsed element with only non-text child nodes.
    • Example: User picture besides a comment on a Github issue. #52

Not sure if this is in the works or something.
I noticed that if there are more than 10 elements on the page, it's impossible to select the first hint.
E.g, if there are 55 elements, I can't jump to 2, because there are 20, 21, 22 etc.
Or is there a way to activate the first hint matching?

Hi @nskmda!

You can press Enter to activate the hint for the number you've typed. So you would press 2 > Enter to do that.

Thanks for letting me know that this behavior was unclear. I've updated the README to explain how this works.