Question about Vuejs and disabled links

I'm currently doing an ADA assessment on a project that is failing on their disabled links because the html rendered is <a disabled="disable"> instead of <a disabled> As far as I can tell, this is how Vuejs renders it because even if I change the <a v-bind:disabled="disabledValue"> to just hard code the <a disabled> Vuejs still seems to change it to <a disabled="disable"> Does anyone know if this is just how Vuejs handles its boolean attributes and if so is there a way around it? I've never used Vuejs before so I'm assuming I'm just missing something.
25 Replies
ἔρως
ἔρως3mo ago
have you tried to set disabledValue to an empty string or null? disabled="" should be the exact same as disabled, so, if you can output an empty string then that might be enough
Scott Borrowman
Scott BorrowmanOP3mo ago
Per ADA compliance, it needs to use the boolean attribute of disabled
ἔρως
ἔρως3mo ago
disabled and disabled="" is the exact same
Joao
Joao3mo ago
@Scott Borrowman I think for something this specific, you might want to try at the Vue.js server directly. https://discord.gg/vue If you find out, please ping me as I'd like to know this as well 😄
ἔρως
ἔρως3mo ago
by the way, which compliance tester are you using?
Scott Borrowman
Scott BorrowmanOP3mo ago
Thanks! Though, it looks like the issue I'm trying to fix needs something different. I need the screen reader to announce that it's disabled and I read that it won't announce disabled="disable" but after more research it seems it only might announce disabled What I need to make sure it's announced is aria-disabled="true" ADA is fun.... hah!
ἔρως
ἔρως3mo ago
that's weird, but makes some sense wait, why are you trying to disable a link? and a link without an href at that... i dont think that a link even has a disabled attribute
Scott Borrowman
Scott BorrowmanOP3mo ago
The site is using anchors for previous and next buttons in their pagination instead of buttons. I'm just trying to fix some of their ADA fails without rebuilding the whole site. And they are using the old <a href="#">
ἔρως
ἔρως3mo ago
can't you change it to <button>? with a tiny bit of css, and a touch in js, it should work
Scott Borrowman
Scott BorrowmanOP3mo ago
"Should" work. They are using this pagination in multiple locations with different css and javascipt for each one. Changing the html could lead to breaking something somewhere without me knowing it
ἔρως
ἔρως3mo ago
Scott Borrowman
Scott BorrowmanOP3mo ago
They do support the aria-disable="true" however
ἔρως
ἔρως3mo ago
which does nothing that is, the link is still enabled
Scott Borrowman
Scott BorrowmanOP3mo ago
It makes the screen reader anounce that it's disable. Which is what I am trying to accomplish.
ἔρως
ἔρως3mo ago
and the disabling of the link is working?
Scott Borrowman
Scott BorrowmanOP3mo ago
Yes, because they are using javascript to handle the click event
ἔρως
ἔρως3mo ago
and the link is styled differently when disabled?
Scott Borrowman
Scott BorrowmanOP3mo ago
Yup. The link itself is working the way they need but right now nothing tells the screen reader that it's disabled
ἔρως
ἔρως3mo ago
then yeah, aria-disabled is the way to go
Scott Borrowman
Scott BorrowmanOP3mo ago
Yup. That is the bandaid fix until I can convince the client they need a new site with code that isn't 10 years old 😆
ἔρως
ἔρως3mo ago
that's actually the permanent solution, if you use links "you" but shhh, don't say that
Scott Borrowman
Scott BorrowmanOP3mo ago
If I were to build this from scratch, I definitely would use buttons instead of links. And I, personally, wouldn't use Vue for pagination
ἔρως
ἔρως3mo ago
i've never used vue, so, can't comment on that part
Scott Borrowman
Scott BorrowmanOP3mo ago
Ya, I've never used it either. Definitely seems weird that it changes disabled to disabled="disabled" though
ἔρως
ἔρως3mo ago
that's probably for html4 compatibility, where attributes must have a value
Want results from more Discord servers?
Add your server