Skip to content

Commit

Permalink
fix(a11y): remove aria-readonly from labels for QField, QCodeol, QD…
Browse files Browse the repository at this point in the history
…ate, QEditor #16705
  • Loading branch information
pdanpdan committed Dec 15, 2023
1 parent 6e92b07 commit 414e571
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
14 changes: 5 additions & 9 deletions ui/src/components/color/QColor.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,11 @@ export default createComponent({
+ (isDark.value === true ? ' q-color-picker--dark q-dark' : '')
)

const attributes = computed(() => {
if (props.disable === true) {
return { 'aria-disabled': 'true' }
}
if (props.readonly === true) {
return { 'aria-readonly': 'true' }
}
return {}
})
const attributes = computed(() => (
props.disable === true
? { 'aria-disabled': 'true' }
: {}
))

const spectrumDirective = computed(() => {
// if editable.value === true
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/date/QDate.js
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ export default createComponent({
const attributes = computed(() => (
props.disable === true
? { 'aria-disabled': 'true' }
: (props.readonly === true ? { 'aria-readonly': 'true' } : {})
: {}
))

watch(() => props.modelValue, v => {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/editor/QEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ export default createComponent({
const attributes = computed(() => (
props.disable === true
? { 'aria-disabled': 'true' }
: (props.readonly === true ? { 'aria-readonly': 'true' } : {})
: {}
))

function onInput () {
Expand Down
3 changes: 0 additions & 3 deletions ui/src/composables/private/use-field.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,6 @@ export default function (state) {
if (props.disable === true) {
acc[ 'aria-disabled' ] = 'true'
}
else if (props.readonly === true) {
acc[ 'aria-readonly' ] = 'true'
}

return acc
})
Expand Down

0 comments on commit 414e571

Please sign in to comment.