Skip to content

Commit

Permalink
Merge pull request #12997 from Abhishek-Punhani/Issue#12238
Browse files Browse the repository at this point in the history
Replaced the Placeholder with 'Find' for smaller screen sizes
  • Loading branch information
AlexVelezLl authored Jan 15, 2025
2 parents 779e62c + 5f653d0 commit c9b1923
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions packages/kolibri-common/components/SearchBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
class="search-input"
:class="$computedClass(searchInputStyle)"
dir="auto"
:placeholder="placeholder || coreString('searchLabel')"
:placeholder="computedPlaceholder"
>
<div class="search-buttons-wrapper">
<KIconButton
Expand Down Expand Up @@ -61,11 +61,18 @@

<script>
import commonCoreStrings from 'kolibri/uiText/commonCoreStrings';
import commonCoreStrings, { coreString } from 'kolibri/uiText/commonCoreStrings';
import useKResponsiveWindow from 'kolibri-design-system/lib/composables/useKResponsiveWindow';
export default {
name: 'SearchBox',
mixins: [commonCoreStrings],
setup() {
const { windowBreakpoint } = useKResponsiveWindow();
return {
windowBreakpoint,
};
},
props: {
icon: {
type: String,
Expand Down Expand Up @@ -117,6 +124,12 @@
textAlign: this.isRtl ? 'right' : '',
};
},
computedPlaceholder() {
if ([3, 4].includes(this.windowBreakpoint)) {
return this.placeholder || this.$tr('find');
}
return this.placeholder || coreString('searchLabel');
},
},
watch: {
value(current) {
Expand Down Expand Up @@ -152,6 +165,9 @@
this.$emit('change', this.searchInputValue);
},
},
$trs: {
find: 'Find',
},
};
</script>
Expand Down Expand Up @@ -184,6 +200,9 @@
padding: 0;
padding-left: 8px;
margin: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
vertical-align: middle;
border: 0;
Expand Down

0 comments on commit c9b1923

Please sign in to comment.