Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ describe('OcSearchBar', () => {
searchButtonWrapper: '.oc-search-button-wrapper',
searchClearButton: '.oc-search-clear'
}
it('should have an id', () => {
const wrapper = getWrapper()
expect(wrapper.find('input').attributes('id')).toBeDefined()
})
describe('search grid role', () => {
it('should be undefined if filter is enabled', () => {
const wrapper = getWrapper({ isFilter: true })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
>
<div class="flex-1 relative">
<input
:id="inputId"
v-model="model"
:class="inputClass"
:aria-label="label"
Expand Down Expand Up @@ -56,7 +57,7 @@
</template>

<script lang="ts" setup>
import { computed, unref, watch } from 'vue'
import { computed, unref, useId, watch } from 'vue'
import { useGettext } from 'vue3-gettext'
import OcButton, { Props as OcButtonProps } from '../OcButton/OcButton.vue'
import OcIcon from '../OcIcon/OcIcon.vue'
Expand Down Expand Up @@ -190,6 +191,7 @@ defineSlots<Slots>()

const { $gettext } = useGettext()

const inputId = `search-input-${useId()}`
const inputClass = computed(() => {
const classes = [
'oc-search-input',
Expand Down