luke-chang / js-spatial-navigation

A javascript-based implementation of Spatial Navigation.
Mozilla Public License 2.0
370 stars 117 forks source link

FIX default element with selector #50

Closed erwanlfrt closed 2 years ago

erwanlfrt commented 2 years ago

Fix the issue : https://github.com/luke-chang/js-spatial-navigation/issues/48

luke-chang commented 2 years ago

@erwanlfrt, Thanks so much for your patch.

During the review, I just noticed that something goes wrong in getSectionDefaultElement. For instance, defaultElement is supposed to accept "a NodeList or an array containing DOM elements" according to README but it's not now. Therefore, instead of merging your PR, I decided to refactor this function a bit. The commit has been pushed to master already. Please let me know if it works for you. Thanks again for pointing it out.