Skip to content

Commit

Permalink
Search text overlaid on the search location filter fix (#9856)
Browse files Browse the repository at this point in the history
* Search text overlaid on the search location filter fix

* SearchBar sets input margin dynamically
  • Loading branch information
jacob-nv authored Nov 6, 2023
1 parent dfd4916 commit 816be91
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions packages/design-system/src/components/OcSearchBar/OcSearchBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
</template>

<script lang="ts">
import { defineComponent, ref, watch } from 'vue'
import { computed, defineComponent, ref, useSlots, watch } from 'vue'
import OcButton from '../OcButton/OcButton.vue'
import OcGrid from '../OcGrid/OcGrid.vue'
Expand Down Expand Up @@ -227,6 +227,7 @@ export default defineComponent({
},
emits: ['advancedSearch', 'clear', 'input', 'keyup', 'search'],
setup(props) {
const slots = useSlots()
const query = ref<string>('')
watch(
() => props.value,
Expand All @@ -236,8 +237,14 @@ export default defineComponent({
}
}
)
const inputIconRightPadding = computed(() => {
if (slots.locationFilter().length > 0) {
return '125px'
}
return '48px'
})
return { query }
return { query, inputIconRightPadding }
},
computed: {
searchQuery() {
Expand Down Expand Up @@ -339,7 +346,8 @@ export default defineComponent({
}
&-input-icon {
padding: 0 var(--oc-space-xlarge) !important;
padding-left: var(--oc-space-xlarge) !important;
padding-right: v-bind(inputIconRightPadding) !important;
}
&-input-button {
Expand Down

0 comments on commit 816be91

Please sign in to comment.