Skip to content

Commit

Permalink
location search bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
SaqibSyed1014 committed Aug 20, 2024
1 parent f6b5d32 commit f2162f1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions components/core/ListingFilters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const props = withDefaults(defineProps<{
wageType?: string
includeAllJobs?: boolean
filtersLoading: boolean
showFacetCount: boolean
showFacetCount?: boolean
}>(), {
showFacetCount: true
});
Expand All @@ -24,7 +24,7 @@ const emits = defineEmits([
const filterState = ref(JSON.parse(JSON.stringify(props.filtrationList)));
const selectedValues = ref<{ field: string, values: string[] }[]>([]);
const savedCompensationValues = ref<number[]>(props.selectedCompensation);
const savedCompensationValues = ref<number[]>(props?.selectedCompensation || []);
const selectedWageType = ref(props.wageType);
const includeAllJobs = ref(props.includeAllJobs);
Expand Down
14 changes: 9 additions & 5 deletions components/core/SearchBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,20 @@ watch(() => props.queryValue, (val) => {
searchedValue.value = val.q === '*' ? '' : val.q
})
watch(() => props.location, (val) => {
const field = document.getElementById('mapInput') as HTMLInputElement;
if (val?.length) {
field.value = val;
}
})
watch(() => props.coordinates, (val) => {
if (val) coordinates.value = val
})
onMounted(() => {
setTimeout(() => {
const field = document.getElementById('mapInput') as HTMLInputElement
if (props.location) {
field.value = props.location
// field.focus()
}
const field = document.getElementById('mapInput') as HTMLInputElement;
field.addEventListener('keyup', function (event :KeyboardEvent) {
if (event.key === 'Enter' && (coordinates.value.lat !== 0 && coordinates.value.lng !== 0))
performSearch();
Expand Down Expand Up @@ -70,6 +73,7 @@ function checkFieldInput() {
<SvgoSearch class="w-4 h-4 text-gray-400" />
<input
v-model="searchedValue"
id="searchKeywordField"
type="text"
placeholder="Keyword, Job title..."
class="w-full"
Expand Down
1 change: 0 additions & 1 deletion pages/jobs/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ async function doSearch(resetToDefaultPage = false) {
}
function updateFiltersWithFacetCounts() {
console.log('facet filters', filters.value)
filters.value.map((filter) => {
if (filter.type === 'checkbox') {
facetCounts.value.forEach((facet) => {
Expand Down

0 comments on commit f2162f1

Please sign in to comment.