I just checked the latest version of the module and I can confirm that the scroll
object is inside the tools
parameter as your code shown.
I have found another issue that is preventing the scrolling. The selectedElement
parameter has to be inside a jquery wrapper in order to play correctly with the scroll helpers. I'll change the implementation of it now to avoid requiring the wrapper and I'll release a new version of the extension but it will take a while until it gets published. In the meantime I recommend you change the action to
action: ({ selectedElement, tools }) => {
tools.scroll.down(tools.jQuery(selectedElement));
},
I recommend you add a property called name
to the object that defines the context 'scroll-area'. It will replace the Global
label that is next to the mic picture after selecting an element that can be scrolled.
context: 'scroll-area',
name: 'scroll area'
switchOnSelectElement: el => el.classList.contains('hands-free-scrollable'),
Something to think about, what do you want to happen if there are no elements that can be scrolled? Maybe you can default to the entire body
in that case?
I'll think about how you can ask the extension to render the allowed voice commands as a list at the bottom of the screen. I think the list would be [Up | Down | Exit]