vimium icon indicating copy to clipboard operation
vimium copied to clipboard

Hints don't show for tiny inputs (react-select)

Open sarink opened this issue 7 years ago • 6 comments

I'm using react-select on a site we're building and for some reason none of the inputs are fable. It uses a regular non-readonly not-disabled not-hidden input.

I finally tracked this down mystery: https://github.com/philc/vimium/blob/17fb86e02971948f90215934cbe5417674364a29/lib/dom_utils.coffee#L124 - apparently vimium mandates that inputs must be at least 3px wide? However, the react-select lib hard codes its input to be just 2px wide (and via an inline-style) 😞

Is there any reason for this 3px mandate? Could we reduce it to 2? Or 1? Or maybe make it based on the area? Or if there's a really good reason for this, should I go bring up an issue over in the react-select repo?

sarink avatar Sep 21 '18 00:09 sarink

I can not find which line the 2px is from in source code of React Select, but as far as I find, the width in real world may be 5px (https://jedwatson.github.io/react-select/), 2px (https://react-select.com/styles) and 1px (https://github.com/JedWatson/react-select/blob/master/src/internal/DummyInput.js#L21).

So maybe Vimium needs looser checks, or we have to wait React Select to change its design.

gdh1995 avatar Sep 23 '18 12:09 gdh1995

What's the reasoning behind vimiums current approach? Looser vimium checks seem like the best idea, 3px seems pretty arbitrary, but perhaps there's a good reason for this that I don't know about.

sarink avatar Sep 23 '18 18:09 sarink

I find the 3px limit is from https://github.com/philc/vimium/commit/99848a6dedfda243f02f4544ed309f8d4f869f1c .

gdh1995 avatar Sep 25 '18 15:09 gdh1995

Interesting. Are there any measurements of this "performance problem"? At a cursory glance, it feels a little dubious, especially since getBoundingClientRect isn't very performant itself, I would guess that's what makes this method slow.

sarink avatar Sep 27 '18 14:09 sarink

In my opinion, the intention of w >= 3 && h >= 3 is to exclude those decorative UI elements which may be mistakenly recognized as "clickable" by Vimium.

Would a special green light for tiny <input>s be enough? Example: require its width >= 1 and height >= 8.

gdh1995 avatar Sep 27 '18 14:09 gdh1995

This issue is still happening to this day and it's happening with all size of Select components of react-select (6 years after), I've tried other extensions like SurfingKeys and they don't have this problem. @philc can we have any updates on this?

RiQuY avatar May 06 '24 08:05 RiQuY