Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/primefaces/primeng
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Mar 29, 2024
2 parents e93ab4c + 48a3b3b commit 2186e27
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
20 changes: 13 additions & 7 deletions src/app/components/cascadeselect/cascadeselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
Output,
QueryList,
signal,
SimpleChanges,
TemplateRef,
ViewChild,
ViewEncapsulation
Expand Down Expand Up @@ -295,7 +296,7 @@ export class CascadeSelectSub implements OnInit {
<div class="p-cascadeselect-items-wrapper" [attr.data-pc-section]="'wrapper'">
<p-cascadeSelectSub
class="p-cascadeselect-items"
[options]="processedOptions()"
[options]="processedOptions"
[selectId]="id"
[focusedOptionId]="focused ? focusedOptionId : undefined"
[activeOptionPath]="activeOptionPath()"
Expand Down Expand Up @@ -618,6 +619,8 @@ export class CascadeSelect implements OnInit, AfterContentInit {

modelValue = signal<any>(null);

processedOptions: string[] | string | undefined = [];

get containerClass() {
return {
'p-cascadeselect p-component p-inputwrapper': true,
Expand Down Expand Up @@ -679,11 +682,7 @@ export class CascadeSelect implements OnInit, AfterContentInit {
visibleOptions = computed(() => {
const processedOption = this.activeOptionPath().find((p) => p.key === this.focusedOptionInfo().parentKey);

return processedOption ? processedOption.children : this.processedOptions();
});

processedOptions = computed(() => {
return this.createProcessedOptions(this.options || []);
return processedOption ? processedOption.children : this.processedOptions;
});

label = computed(() => {
Expand All @@ -710,6 +709,13 @@ export class CascadeSelect implements OnInit, AfterContentInit {
return label;
}

ngOnChanges(changes: SimpleChanges): void {
if (changes.options) {
this.processedOptions = this.createProcessedOptions(changes.options.currentValue || []);
this.updateModel(null)
}
}

hasSelectedOption() {
return ObjectUtils.isNotEmpty(this.modelValue());
}
Expand Down Expand Up @@ -1074,7 +1080,7 @@ export class CascadeSelect implements OnInit, AfterContentInit {
}

findOptionPathByValue(value, processedOptions?, level = 0) {
processedOptions = processedOptions || (level === 0 && this.processedOptions());
processedOptions = processedOptions || (level === 0 && this.processedOptions);

if (!processedOptions) return null;
if (ObjectUtils.isEmpty(value)) return [];
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/inputotp/inputotp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class InputOtp implements AfterContentInit {
value: any;

get inputMode(): string {
return this.integerOnly ? 'number' : 'text';
return this.integerOnly ? 'numeric' : 'text';
}

get inputType(): string {
Expand Down

0 comments on commit 2186e27

Please sign in to comment.