Conversation
There was a problem hiding this comment.
This PR fixes both reported issues.
I have found an additional, may be related.
- Go to a proposal page ( being logged in )
- Use tab until you reach the comment button
- Press enter or space, your page will scroll down to the comment box
- Press Tab, The page will move to the next element ( the category link)
Screencast.from.2023-08-21.23-39-21.webm
Is there anything that can be done in the scope of this PR ?
Additionally, i have noticed that focus_guard.js is actually importing keyboard object from foundation website. Is there any plans from your end to remove foundation-sites anytime soon ?
I'm not getting your point. Look at the screencast: after the comment button, the next focusable element is the tag. But if you browse to the comments, the next focusable element becomes the order. I think that0s the expected behaviour. I cannot reproduce the cast you sent. Screencast.from.23-08-23.12.08.05.webm |
I was taking a look at the functions we're using (releaseFocus and trapFocus) and we can fetch just the code we need from Foundation (I'll do a quick test anyway) in order to remove such dependency. This would be slightly dirty approach, but faster. A longer, but better approach, would be use an external library like focus-trap, which would become deprecated the current focus_guard.js, since that logic is already included in the library. But, I believe you @decidim/maintainers should consider to go this way or not, as we would be talking about replacing a present feature. |
|
@alecslupu I did the quick test. Share your thoughts, if you want to. |
|
I'm doing another test just in case, @alecslupu, but I'm afraid I'm gonna revert the last commits, as removing Foundation from the focus_guard provokes a cascade of problems |
I confirm that now is ok for me as well (works only with enter, and not space). |
Eventually the Foundation needs to be removed. I do like the idea of focus-trap, but I am not 100% sure how much would be the browser payload if we add that library as well ... Let's revert the changes, as removing foundation is not in the scope of this PR. |
d105704 to
111f4a8
Compare
|
Last three commits removed |
🎩 What? Why?
Keep the focus where it takes, after any keyboard interactions on dialogs
📌 Related Issues
📷 Screenshots
https://decidim-redesign.populate.tools/processes/Decidim4Dummies/f/1941/