Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/primefaces/primevue
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Dec 30, 2024
2 parents 3161e53 + 2950c76 commit ec0a5f4
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ const classes = {
'p-cascadeselect-label',
{
'p-placeholder': instance.label === props.placeholder,
'p-cascadeselect-label-empty': !instance.$slots['value'] && (instance.label === 'p-emptylabel' || instance.label.length === 0)
'p-cascadeselect-label-empty': !instance.$slots['value'] && (instance.label === 'p-emptylabel' || instance.label?.length === 0)
}
],
clearIcon: 'p-cascadeselect-clear-icon',
Expand Down
2 changes: 2 additions & 0 deletions packages/primevue/src/datepicker/DatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1329,6 +1329,8 @@ export default {
if (lookAhead(match)) {
while (num.length < len) {
num = '0' + num;
this.selectionStart = this.selectionStart + 1;
this.selectionEnd = this.selectionEnd + 1;
}
}
Expand Down
14 changes: 8 additions & 6 deletions packages/primevue/src/select/Select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,10 @@ export default {
hasFocusableElements() {
return getFocusableElements(this.overlay, ':not([data-p-hidden-focusable="true"])').length > 0;
},
isOptionMatched(option) {
isOptionExactMatched(option) {
return this.isValidOption(option) && typeof this.getOptionLabel(option) === 'string' && this.getOptionLabel(option)?.toLocaleLowerCase(this.filterLocale) == this.searchValue.toLocaleLowerCase(this.filterLocale);
},
isOptionStartsWith(option) {
return this.isValidOption(option) && typeof this.getOptionLabel(option) === 'string' && this.getOptionLabel(option)?.toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale));
},
isValidOption(option) {
Expand Down Expand Up @@ -846,11 +849,10 @@ export default {
let matched = false;
if (isNotEmpty(this.searchValue)) {
if (this.focusedOptionIndex !== -1) {
optionIndex = this.visibleOptions.slice(this.focusedOptionIndex).findIndex((option) => this.isOptionMatched(option));
optionIndex = optionIndex === -1 ? this.visibleOptions.slice(0, this.focusedOptionIndex).findIndex((option) => this.isOptionMatched(option)) : optionIndex + this.focusedOptionIndex;
} else {
optionIndex = this.visibleOptions.findIndex((option) => this.isOptionMatched(option));
optionIndex = this.visibleOptions.findIndex((option) => this.isOptionExactMatched(option));
if (optionIndex === -1) {
optionIndex = this.visibleOptions.findIndex((option) => this.isOptionStartsWith(option));
}
if (optionIndex !== -1) {
Expand Down
1 change: 1 addition & 0 deletions packages/primevue/src/tree/Tree.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ describe('Tree.vue', () => {

let searchField = wrapper.find('input.p-inputtext');
const key = 't';

searchField.element.value = key;

await searchField.trigger('keyup', {
Expand Down
7 changes: 4 additions & 3 deletions packages/primevue/src/virtualscroller/VirtualScroller.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,12 @@ export default {
this.d_loading = newValue;
}
},
items(newValue, oldValue) {
if (!oldValue || oldValue.length !== (newValue || []).length) {
items: {
handler(newValue) {
this.init();
this.calculateAutoSize();
}
},
deep: true
},
itemSize() {
this.init();
Expand Down
Loading

0 comments on commit ec0a5f4

Please sign in to comment.