Skip to content

Commit

Permalink
Add draft for fixing (aria-)label bug on OcSelect
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalwengerter committed Apr 23, 2024
1 parent a7d3f43 commit 7675f7e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
data-testid="oc-page-size-label"
v-text="label"
/>
<!-- Streamline label above into oc-select? -->
<oc-select
:input-id="selectId"
class="oc-page-size-select"
Expand Down
16 changes: 14 additions & 2 deletions packages/design-system/src/components/OcSelect/OcSelect.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<template>
<div>
<label v-if="label" :for="id" class="oc-label" v-text="label" />
<label
v-if="label"
:for="id"
:class="{ 'oc-invisible-sr': isLabelHidden }"
class="oc-label"
v-text="label"
/>
<oc-contextual-helper
v-if="contextualHelper?.isEnabled"
v-bind="contextualHelper?.data"
Expand Down Expand Up @@ -279,6 +285,10 @@ export default defineComponent({
readOnly: {
type: Boolean,
default: false
},
isLabelHidden: {
type: Boolean,
default: false
}
},
emits: ['search:input', 'update:modelValue'],
Expand All @@ -303,7 +313,9 @@ export default defineComponent({
}
onMounted(() => {
setComboBoxAriaLabel()
if (!props.label) {
setComboBoxAriaLabel()
}
})
const dropdownEnabled = ref(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<oc-select
ref="tagSelect"
v-model="selectedTags"
:label="$gettext('Add or edit tags')"
:is-label-hidden="true"
class="tags-select"
:multiple="true"
:disabled="readonly"
Expand Down

0 comments on commit 7675f7e

Please sign in to comment.