Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I cannot select scrollable element without a scroll bar. #147

Closed
crocket opened this issue Mar 31, 2020 · 21 comments
Closed

I cannot select scrollable element without a scroll bar. #147

crocket opened this issue Mar 31, 2020 · 21 comments

Comments

@crocket
Copy link

crocket commented Mar 31, 2020

YouTube sidebar often doesn't have a scroll bar, but it is scrollable.
So, I often cannot choose the YouTube sidebar after pressing f.

There are many scrollable elements without a scroll bar.

@crocket crocket changed the title I cannot select scrollable element that doesn't have a scroll bar. I cannot select scrollable element without a scroll bar. Mar 31, 2020
@gdh1995
Copy link
Owner

gdh1995 commented Mar 31, 2020

LinkHints will show a red hint marker for those "scrollable", and after one selects such a marker j will scroll the area, but if there's no marker for one area, then it means the page is using JavaScript to manually deal with scrolling requests.

If there're some demo URLs and snapshots, maybe I can improve the detection logic - while of course it's not always possible.

@crocket
Copy link
Author

crocket commented Mar 31, 2020

The sidebar on youtube.com shows a scrollbar only when the mouse cursor is on the sidebar.

youtube sidebar

On London Real YouTube channel, there are scrollable elements.

youtube channel scrollable elements

On slant, you can also see a scrollable element without a scrollbar.

slant scrollable element

If I press ;fs, SurfingKeys extension displays hints for those scrollable elements.

@gdh1995
Copy link
Owner

gdh1995 commented Mar 31, 2020

The 1st snap on Youtube: it's strange that I found "the box is scrollable on Chrome" - according what I saw in its source code, it should be never scrollable. I'll test more in days.

2nd snap of "latest interviews": you may use LinkHints to click the left/right buttons - my touchpad could not directly scroll the boxes left or right, so I think it's OKay for Vimium C to treat them as not scrollable.

3rd of slant: the left/right arrow buttons are also hinted by LinkHints.

@gdh1995
Copy link
Owner

gdh1995 commented Mar 31, 2020

If I press ;fs, SurfingKeys extension displays hints for those scrollable elements.

Then how does SurfingKeys scroll the boxes, on what keyboard shortcuts?

@crocket
Copy link
Author

crocket commented Mar 31, 2020

Then how does SurfingKeys scroll the boxes, on what keyboard shortcuts?

0 scrolls all the way to the left
$ scrolls all the way to the right.
h scrolls left.
l scrolls right.
j scrolls down.
k scrolls up.
d scrolls half a page down.
e and u scroll half a page up.

The usual scrolling keys apply.

I can use the scrolling buttons, but it is more convenient to use scrolling keys.
I wish there were equivalents of d and u for horizontal scrolls.
If you take care of the youtube sidebar, you take care of the rest automatically as a side effect.

@gdh1995
Copy link
Owner

gdh1995 commented Apr 2, 2020

Confirmed that SurfingKeys can find them, though it also shows some wrong hints after ;fs on some sites.

The sidebar of YouTube uses a dynamic CSS style to make it "scrollable only when a mouse is on it"; the other places use JavaScript code to do real scrolling, so it's somehow "correct" that Vimium C thinks they are not scrollable.

Maybe I can add a new mode like LinkHints.activateModeToScroll to also show hints for such elements.

gdh1995 added a commit that referenced this issue Apr 4, 2020
E.g.: YouTube sidebar: only `overflow: auto` on hover.

So either click it first, or `map f LinkHints.activateMode scroll="force"`

This is for #147 .
@gdh1995
Copy link
Owner

gdh1995 commented Apr 4, 2020

Here's a new version, and map f LinkHints.activate scroll="force" will make LinkHints think more elements are clickable.

Please test this: vimium_c-1.81.4-chrome-611e169.zip, vimium_c-1.81.4-firefox-611e169.zip.

Install:

  • unzip a zip file into an empty folder
  • if on Chrome, open chrome://extensions/ and enable the "developer mode"
  • if on Firefox, open about:debugging#/runtime/this-firefox manually
  • click the "load extension" button and select the extension folder or manifest.json

@crocket
Copy link
Author

crocket commented Apr 5, 2020

In chrome, vivaldi, and brave, the chrome extension fixed the issue.
In firefox, it fixes the issue, but I can't shift the focus of scroll back to the main contents with f on youtube.com

@gdh1995
Copy link
Owner

gdh1995 commented Apr 5, 2020

map Ff LinkHints.activateModeToHover may help, because it simulates "mouse hover" events on a target element and notifies Scroller to select the target.

@crocket
Copy link
Author

crocket commented Apr 5, 2020

Ff correctly puts the scroll focus back to the main contents on firefox, but having two shortcuts for the same thing is confusing. I still haven't understood how it works.

@gdh1995
Copy link
Owner

gdh1995 commented Apr 5, 2020

  • LinkHints.activateMode simulates "click" action.
  • LinkHints.activateModeToHover simulates "mouse hover" action, and it has a side effect of notifying Scroller to remember an element or its container should be scrolled

@crocket
Copy link
Author

crocket commented Apr 5, 2020

What are you going to do?

@gdh1995
Copy link
Owner

gdh1995 commented Apr 5, 2020

What? Sorry I don't understand your last comment.

@crocket
Copy link
Author

crocket commented Apr 5, 2020

It seems you figured out how to fix the issue. How are you going to fix this issue?
Do you need more information from me?

@gdh1995
Copy link
Owner

gdh1995 commented Apr 5, 2020

Um, the zip file is just the version that "fixes" this issue: the 3 examples you gave are "not scrollable by default", and all require pages' JavaScript code / special CSS status to do scrolling; but Vimium C can not recognize whether an element is "scrollable if relaxing some rules" or not, so I added an option of scroll="force" to let users choose what rules it should use.

If you agree that this version is enough, then a new release will arrive in next 5~10 days with logic in this zip file.

Updated: I used to close an issue when a new version for it had released for days, while if you like you may close it at any time.

@crocket
Copy link
Author

crocket commented Apr 5, 2020

I think the new version is good enough. I'd like some documentation on LinkHints.activate and LinkHints.activateModeToHover because I didn't know they existed.

@gdh1995
Copy link
Owner

gdh1995 commented Apr 5, 2020

Sorry but in recent months (years?) I have no enough patience and time to write documents - I would rather write new features or relax & sleep ...

@gdh1995
Copy link
Owner

gdh1995 commented Apr 5, 2020

On the Vimium C Options page, press ? and you may see a help dialog of Vimium C, and click "show advanced commands" at its bottom-right corner to see the whole list of available commands.

@crocket
Copy link
Author

crocket commented Apr 6, 2020

show available commands shows parameters and parameter values of functions. Ideally, I'd like some documentation for scroll. But, feel free to solve this issue in any way you want to.

@gdh1995
Copy link
Owner

gdh1995 commented Apr 15, 2020

v1.81.5 has been released.

@gdh1995 gdh1995 closed this as completed Apr 15, 2020
@crocket
Copy link
Author

crocket commented Apr 15, 2020

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants