-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
Clear search input fix #430
Open
pavelpugachh
wants to merge
2
commits into
bithost-gmbh:master
Choose a base branch
from
pavelpugachh:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+1
−1
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Clear search input only if value exists
Update mat-select-search.component.ts
As long as we don't cause regression on my code I'm fine with it. :P this.transaction_ledger_id_filter.valueChanges
.pipe(
tap(() => (this.searching = true)),
takeUntil(this.onDestroy),
debounceTime(100),
switchMap((search) => {
if (search) {
return this.ledgerService.search(search)
} else {
if (this.transaction.transaction_ledger_id) {
return this.ledgerService.getOne(this.transaction.transaction_ledger_id).pipe(map((ledger) => [ledger]))
} else {
return this.ledgerService.getAll()
}
}
}),
takeUntil(this.onDestroy)
)
.subscribe({
next: (filteredLegers) => {
this.searching = false
this.ledgers.next(filteredLegers)
},
error: (error) => {
console.error(error)
this.searching = false
}
}) |
Its unclear to me why this is needed. |
Without this valueChanges is triggered when I click on a field and close it
without selecting anything. It’s already empty, value doesn’t change.
Пн, 22 апр. 2024 г. в 09:42, Esteban Gehring ***@***.***>:
… Its unclear to me why this is needed.
@pavelpugachh <https://github.com/pavelpugachh> can you elaborate the
scenario this fixes?
—
Reply to this email directly, view it on GitHub
<#430 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BBRQAJUAP6BS3VK6DQDT64TY6SWMVAVCNFSM6AAAAAA2Z5RFS6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRYGYYDIMJRHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@pavelpugachh thanks for the explanation. i would suggest to move the check to the _reset method, wdyt? |
Sure, that would be better :)
Пн, 22 апр. 2024 г. в 10:09, Esteban Gehring ***@***.***>:
… @pavelpugachh <https://github.com/pavelpugachh> thanks for the
explanation. i would suggest to move the check to the _reset method, wdyt?
—
Reply to this email directly, view it on GitHub
<#430 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BBRQAJWKICPFTBAHPS67JFLY6SZSRAVCNFSM6AAAAAA2Z5RFS6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRYGY2DINBWGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Any update? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Clear search input only if value exists not to trigger valueChanges