-
Notifications
You must be signed in to change notification settings - Fork 470
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
fix(core): Input
with DataList
never shows dropdown after its 1st closing
#9881
Merged
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
Pull request was closed ✔️All saved screenshots (for current PR) were deleted 🗑️ |
splincode
approved these changes
Dec 2, 2024
Visit the preview URL for this PR (updated for commit 51d0683): https://taiga-ui--pr9881-fix-doc-search-bawbhf8l.web.app (expires Tue, 03 Dec 2024 12:07:44 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 4b5ece1e114386f6a105425ef799091475b249eb |
BundleMonFiles updated (1)
Unchanged files (4)
Total files change +35B +0.01% Groups updated (1)
Final result: ✅ View report in BundleMon website ➡️ |
nsbarsukov
requested review from
waterplea,
MarsiBarsi,
vladimirpotekhin and
mdlufy
as code owners
December 2, 2024 11:55
nsbarsukov
changed the title
fix(kit):
fix(core): Dec 2, 2024
Input
with DataList
never shows dropdown after its 1st closingInput
with DataList
never shows dropdown after its 1st closing
mdlufy
approved these changes
Dec 2, 2024
waterplea
approved these changes
Dec 3, 2024
Merged
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.
Fixes #9666
Reproduction 1
acc
c
againExpected behavior: dropdown is shown
Actual behavior: you will never see dropdown again
Reproduction 2
Expected behavior: dropdown is shown
Actual behavior: you will never see dropdown again
Explore more:
https://stackblitz.com/edit/input-with-datalist-v3-bug?file=src%2Fapp%2Fapp.component.ts
Why bug happens ?
Everything starts from here:
taiga-ui/projects/kit/components/input/input.template.html
Lines 1 to 5 in 7c746b6
taiga-ui/projects/kit/components/input/input.component.ts
Lines 108 to 110 in 7c746b6
It means that every keystroke opens dropdown.
This method decides should it can it be opened or not
taiga-ui/projects/kit/components/input/input.component.ts
Lines 104 to 105 in 7c746b6
Then props drilling finishes here:
taiga-ui/projects/core/components/hosted-dropdown/hosted-dropdown.template.html
Lines 7 to 8 in ab05df0
taiga-ui/projects/core/components/hosted-dropdown/dropdown-open-monitor.directive.ts
Lines 15 to 17 in 7c746b6
DropdownOpenMonitor
should not update its host (host is controlled outside insideHostedDropdown
codebase).DropdownOpenMonitor
should only update externalDropdownOpen
(if host decides to close dropdown) or vice versa.Are there any other solutions ?
We could listen to
openChange
here and callthis.cdr.detectChanges
on any UPSTREAM data-flow ([open]
should be recalculated after view updates are already finished).taiga-ui/projects/kit/components/input/input.template.html
Line 5 in 7c746b6
It is dangerous solution because it can cause
ExpressionChangedAfterItHasBeenCheckedError
.