-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[pagination] Make isActive a method #376
Conversation
Computed properties cannot take arguments. As-is, pagination component is entirely broken and will not render.
Oops, that was my mistake. |
No problem. Just a heads up that I'm looking at the keyboard focus stuff in paginator now. If you happen to be actively working on it, let me know and I'll hold off, otherwise I'll try to get another PR up later to fix it up. The first issue is the ref="buttons" on the multiple button elements results in this.$refs.buttons pointing only to the last button, so the find() and indexOf() functions fail in the focusXXX() methods (vue will use an array for the ref if it is only used within v-for, but subsequent ref="buttons" overrides it). I've worked around that, but now catching edge cases in focus traversal that don't seem to be handled. |
Let me play with it a bit more, and see if my logic is a bit off. |
@charkins , take a look at https://github.com/tmorehouse/bootstrap-vue/blob/tmorehouse-pagination/lib/components/pagination.vue I have refactored how the buttons are gathered into an array |
That's pretty much the same approach I took. Two problems:
With those changes the errors go away, but focus doesn't change for me. I had similar issues elsewhere in my code where I need to use this.$nextTick(()=>someElement.focus()) to get focus to actually change. When I added that approach to the paginator, focusCurrent would get called before focus changed and mess things up for me. I'll keep playing with it a bit. What browser are you using? I've tested both chrome and firefox on linux and cannot get focus to change without using nextTick: google-chrome-stable-58.0.3029.81-1.x86_64 |
I'm using chrome on an old OS :( I'll make the changes you suggested and add in next tick for focusing. |
It still doesn't quite work with nextTick. I didn't thoroughly debug yet, but I believe focusNext does nextTick focus, then focusCurrent gets called before the nextTick executes and ends up scheduling another nextTick focus which sets the focus back to the originally focused button. |
I wonder if the |
Ah, I see the focus current issue now. The |
That does it! Seems obvious now. |
Yeah. one of those silly things that you can stare at for awhile and not see it. |
I'll issue a PR for the changes. I'l;l also double check the toolbar optional keyboard navigation to make sure it is doing a |
Thanks. I'll re-test once I see the changes merged upstream. |
The |
Computed properties cannot take arguments. As-is, pagination
component is entirely broken and will not render.