-
Notifications
You must be signed in to change notification settings - Fork 459
[AutoComplete] Only render placeholder attribute when the parameter is provided #3919
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
Conversation
|
@dvoituron I've updated it :) |
|
I don't understand why the unit tests must be updated |
When you add the null-check to the placeholder attribute it breaks some of the existing unit tests because they expected either no placeholder at all or an empty placeholder. You can verify this by adding the null check as I did and run the old tests. |
|
@dvoituron this happens when you add just the null check. The old tests doesn't specify a placeholder. Therefor it rendered an empty placehodler attribute before. Which will no longer happens because we also check against null. |
|
Yes. I know you fixed the unit tests. And these changes solve that. But why the Placeholder is null and was empty in the dame situation. The issue is only when Multiple=False. So the current unit tests should be identical. |
|
@dvoituron pretty simple. This is the old line: Placeholder="@(SelectedOptions?.Any() is false ? Placeholder : string.Empty)"This is the new line Placeholder="@(SelectedOptions is null || SelectedOptions?.Any() is false ? Placeholder : string.Empty)"
Placeholder="@(SelectedOptions is null || SelectedOptions?.Any() is false ? Placeholder : null)"When we doing it like this then the |
|
I've added a commit which removes |
|
Why to change that? This is an optimization, not a solution for this issue. Next time, try to create 2 PR to update 2 concepts. That easier to track the goal of PRs. |
|
@dvoituron this goes hand-in-hand together. The null check is required to fix it for single-mode. The tests needed to be adapted either way. With 2 PRs we would change the tests twice. If you want though I can close this PR and open another one where I just update the line to the last version and update the tests. |
|
I just approved it. What I mean is that a bug fix should only fix this problem. This makes it easier to track changes later on. If we ever find that other bugs arise. |
|
@dvoituron yea I agree with you. But fixing this problem would require to change the unit tests as well. Therefore I would have changed it to the |
|
This is not normal; the change only applies when Multiple=False. So all current unit tests should pass. |



Pull Request
📖 Description
This PR removes the conditonal check for the placeholder within
FluentAutocomplete. This results in thePlaceholderproperty only being rendered when it is actually supplied.I've updated all unit tests to remove the empty placeholder attribute as well.
🎫 Issues
Fixes #3916
✅ Checklist
General
Component-specific