You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an issue where adding this to a course index page as an embedded element (iframe) causes it to automatically scroll to the content on page load, regardless of where it is on the page. This issue could not be replicated locally consistently, but is caused in this block.
What I'm not sure about is why this focus is required at all? The only time I believe this should be done is when the user clicks on a card, and the dialog card should scroll to the start of the top of the displayed card again (e.g. if it was too vertically high). What it currently does is trigger this code when loaded from an iframe (from what I've noticed), and the main window automatically scrolls to this content.
Platform: Moodle
Tested On Desktop
Happens in Firefox, Chrome, Chromium
H5P plugin version
1.21.0
H5P content type & version "version": "1.7.3"
"name": "h5p-dialogcards"
No console errors
No PHP errors
No env changes
No browser extensions/changes
I'll create and link a PR that fixes the issue I'm experiencing by removing the requirement to focus the card altogether. I might not be too aware of why it was added originally, but I believe unless it is functionally required (e.g. for screen-readers), I do not believe it should trigger a focus() event. If it should trigger a focus event, it should definitely only do so after some user interaction (e.g. changing cards), not on initial load.
The text was updated successfully, but these errors were encountered:
keevan
added a commit
to keevan/h5p-dialogcards
that referenced
this issue
Jul 13, 2021
Outlined here also: https://h5p.org/node/1194058
I have an issue where adding this to a course index page as an embedded element (iframe) causes it to automatically scroll to the content on page load, regardless of where it is on the page. This issue could not be replicated locally consistently, but is caused in this block.
h5p-dialogcards/src/scripts/h5p-dialogcards-card.js
Lines 482 to 484 in 7a7580a
What I'm not sure about is why this focus is required at all? The only time I believe this should be done is when the user clicks on a card, and the dialog card should scroll to the start of the top of the displayed card again (e.g. if it was too vertically high). What it currently does is trigger this code when loaded from an iframe (from what I've noticed), and the main window automatically scrolls to this content.
This is very similar to this linked issue https://h5p.org/node/1150636.
Platform: Moodle
Tested On Desktop
Happens in Firefox, Chrome, Chromium
H5P plugin version
1.21.0
H5P content type & version "version": "1.7.3"
"name": "h5p-dialogcards"
No console errors
No PHP errors
No env changes
No browser extensions/changes
I'll create and link a PR that fixes the issue I'm experiencing by removing the requirement to focus the card altogether. I might not be too aware of why it was added originally, but I believe unless it is functionally required (e.g. for screen-readers), I do not believe it should trigger a focus() event. If it should trigger a focus event, it should definitely only do so after some user interaction (e.g. changing cards), not on initial load.
The text was updated successfully, but these errors were encountered: