Skip to content

Commit

Permalink
Merge pull request #1208 from dpc-sdp/bugfix/R20-1451-search-ui-max-l…
Browse files Browse the repository at this point in the history
…ength

[R20-1451] - Set a max length on site search bar to match search ui max length
  • Loading branch information
dylankelly authored Jun 5, 2024
2 parents f801cb9 + 5ac8a8e commit 8cbd3ed
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/ripple-tide-search/components/TideSearchPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ watch(
:inputValue="searchState.searchTerm"
:suggestions="searchTermSuggestions"
:global-events="false"
maxlength="128"
@submit="handleSubmit"
@update:input-value="updateSearchTerm"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,16 @@ interface Props {
items: IRplPrimaryNavItem[]
showSearch?: boolean
searchUrl?: string
searchMaxLength?: number
showQuickExit?: boolean
}
const props = withDefaults(defineProps<Props>(), {
secondaryLogo: undefined,
showSearch: true,
searchUrl: '/search',
showQuickExit: true
showQuickExit: true,
searchMaxLength: 128
})
const emit = defineEmits<{
Expand Down Expand Up @@ -303,6 +305,7 @@ provide('navFocus', navFocus)
v-if="isSearchActive"
:show-quick-exit="showQuickExit"
:search-url="searchUrl"
:max-length="searchMaxLength"
/>
</div>
<RplPrimaryNavQuickExit v-if="showQuickExit" variant="fixed" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ import { ref, onMounted } from 'vue'
interface Props {
showQuickExit: boolean
searchUrl: boolean
maxLength?: number
}
const searchBar = ref(null)
const props = withDefaults(defineProps<Props>(), {})
const props = withDefaults(defineProps<Props>(), {
maxLength: 128
})
const handleSubmit = (event) => {
window.location.href = `${props.searchUrl}?q=${event.value}`
Expand Down Expand Up @@ -38,6 +41,7 @@ onMounted(() => {
ref="searchBar"
variant="menu"
placeholder="Start typing..."
:maxlength="maxLength"
@submit="handleSubmit"
/>
</div>
Expand Down

0 comments on commit 8cbd3ed

Please sign in to comment.