Skip to content
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

put roles in some elements of sugarCube. #232

Open
metalalchemist opened this issue May 3, 2023 · 5 comments
Open

put roles in some elements of sugarCube. #232

metalalchemist opened this issue May 3, 2023 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@metalalchemist
Copy link

Is your feature request related to a problem?
hello when i am playing my game in ifone, the device don't recognice links with voice ovber. i am a blind person.
Describe the solution you'd like.
put some roles in elements linke links and buttons like.

$(document).on(":passagerender", function (event) {
var clinks = $(event.content).find(".link-internal");
if (clinks.length) {
clinks.attr( "role", "link");
}
var clinks = $(event.content).find('.macro-button');
if (clinks.length) {
clinks.attr( "role", "button");
}
});

sorry my english is so bad and i don't understand so mutch js.

@metalalchemist metalalchemist added the enhancement New feature or request label May 3, 2023
@greyelf
Copy link

greyelf commented May 3, 2023

@metalalchemist
The current Markup based and Macro based link implementations, and the <<button>> macro implementation, already include a role="link" assignment in the HTML <a> and <button> elements they generate.

eg. If the following was placed in a Passage...

[[Lable Text|Target Passage]]

<<link "Lable Text" "Target Passage">><</link>>

<<button "Lable Text" "Target Passage">><</button>>

...the following HTML elements would be generated...

<a data-passage="Target Passage" class="link-internal" role="link" tabindex="0">Lable Text</a>

<a data-passage="Target Passage" class="link-internal macro-link" role="link" tabindex="0">Lable Text</a>

<button data-passage="Target Passage" class="link-internal macro-button" type="button" role="link" tabindex="0">Lable Text</button>

Do you know what Reader software is being used on your iPhone?

Do you know what version of SugarCube was used to build the Story HTML file you are playing?

@metalalchemist
Copy link
Author

i am using voice over and i am using sugarcube 2.36.1.

<button data-passage="Target Passage" class="link-internal macro-button" type="button" role="link"
why do you use role button?
i use buttons for example for a figth passage.

@metalalchemist
Copy link
Author

i forget for compile i am using tweego 2.1.1

@tmedwards
Copy link
Owner

tmedwards commented May 6, 2023

As noted by @greyelf, links (anchors and buttons) already have a role content attribute attached normally, among other accessibility features. The value of the attribute depends on how it's being used (by default: link or button).

I'm going to need a bit more context from you. Can you provide an example of how you're creating the links that you're having issues with. Also, preferably, including the generated markup.

EDIT: Are you using any 3rd-party libraries that could be interfering with SugarCube's normal operation?

@tmedwards tmedwards added question Further information is requested and removed enhancement New feature or request labels May 6, 2023
@tmedwards tmedwards self-assigned this May 6, 2023
@metalalchemist
Copy link
Author

metalalchemist commented May 6, 2023

link macro i thing that have role button cause i recognise in all screen readers like a button.
[[new game|new]] when use sugarcube 2.35 don't have a role and in sugarcube 2.36.1 my ifone don't recognise it like a link. i read like a text plain.
ps: the passage don't focus in the start of this.
for example if i havee 5 lines or more in the reader when down with downarrow i apear in a 4th line no in a 2nd line.
with all screen readers in android and ifone too
i thing that is for the transition?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants