Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAS-131841 / 24.10.2 / ACL Editor Group/User Search Bug (by AlexKarpov98) #11104

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
[ixTest]="controlDirective.name"
[class.has-value]="selectedOption?.label || textContent"
(input)="onChanged(ixInput.value)"
(blur)="onTouch()"
(blur)="inputBlurred()"
/>
<span class="reset-input" [class.with-opacity]="shouldShowResetInput() && !isValueFromOptions(ixInput.value)">
@if (loading) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ export class IxComboboxComponent implements ControlValueAccessor, OnInit {
if (this.value && this.options?.length) {
this.selectedOption = { ...(this.options.find((option: Option) => option.value === this.value)) };
}
if (this.selectedOption) {
this.filterChanged$.next('');
}

this.cdr.markForCheck();
}

Expand All @@ -101,6 +97,14 @@ export class IxComboboxComponent implements ControlValueAccessor, OnInit {
this.filterChanged$.next('');
}

inputBlurred(): void {
this.onTouch();

if (!this.allowCustomValue && !this.selectedOption) {
this.resetInput();
}
}

filterOptions(filterValue: string): void {
this.loading = true;
this.cdr.markForCheck();
Expand All @@ -124,10 +128,6 @@ export class IxComboboxComponent implements ControlValueAccessor, OnInit {
this.selectedOption = selectedOptionFromValue
? { ...selectedOptionFromValue }
: { label: this.value as string, value: this.value };

if (this.selectedOption.value) {
this.filterChanged$.next('');
}
}

this.loading = false;
Expand Down Expand Up @@ -193,7 +193,7 @@ export class IxComboboxComponent implements ControlValueAccessor, OnInit {
}

onChanged(changedValue: string): void {
if (this.selectedOption || this.value) {
if (this.selectedOption?.value || this.value) {
this.resetInput();
}
this.textContent = changedValue;
Expand Down
Loading