Skip to content

Commit

Permalink
Merge pull request #30 from mylmz10/develop
Browse files Browse the repository at this point in the history
Develop to Master
  • Loading branch information
mylmz10 authored May 11, 2024
2 parents 719c437 + 276f6cc commit 49dfda7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/components/autocomplete/MdFilledAutoComplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@
<MdFilledTextField v-model="searchText" :label="props.label" @focus="onTextFieldFocus" @input="onTextFieldInput"></MdFilledTextField>
</template>

<MdList v-if="props.items && props.items.length">
<MdListItem v-for="(item, index) in filteredItems" :selected="modelValue === item" :headline="item" @click="onMenuListItemClick(index)"></MdListItem>
<MdList>
<template v-if="filteredItems.length">
<MdListItem v-for="(item, index) in filteredItems" :selected="modelValue === item" :headline="item" @click="onMenuListItemClick(index)"></MdListItem>
</template>
<template v-else>
<MdListItem headline="No data available"></MdListItem>
</template>
</MdList>
</MdMenu>
</template>
Expand All @@ -26,7 +31,7 @@ let selecting = ref(false);
let isPristine = ref(true);
const filteredItems = computed(() => {
if (!selecting && searchText.value) {
if (!selecting.value && searchText.value) {
return props.items.filter((item) => item.toLocaleLowerCase().includes(searchText.value.toLocaleLowerCase()));
}
return props.items;
Expand Down
4 changes: 4 additions & 0 deletions src/components/field/MdField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,12 @@ const onFocusout = () => {
&__start {
width: 16px;
flex-shrink: 0;
}
&__middle {
position: relative;
width: 100%;
#{$this}__label {
position: absolute;
Expand All @@ -105,6 +107,7 @@ const onFocusout = () => {
z-index: 1;
}
#{$this}__content {
width: 100%;
}
}
Expand Down Expand Up @@ -139,6 +142,7 @@ const onFocusout = () => {
&__end {
width: 16px;
flex-shrink: 0;
}
&__state-layer {
Expand Down
2 changes: 2 additions & 0 deletions src/components/text-field/MdTextFieldBase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ defineProps({
.md-text-field {
display: inline-flex;
outline: none;
width: 100%;
&__field {
cursor: text;
Expand All @@ -49,6 +50,7 @@ defineProps({
color: currentColor;
outline: none;
padding: 0;
width: 100%;
// Remove built-in datepicker icon on Chrome
&::-webkit-calendar-picker-indicator {
Expand Down

0 comments on commit 49dfda7

Please sign in to comment.