-
Notifications
You must be signed in to change notification settings - Fork 8
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
Angular Select placeholder integration #1912
Merged
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
…o select-placeholder
Co-authored-by: Jesse Attas <[email protected]>
Co-authored-by: Jesse Attas <[email protected]>
…o select-placeholder
jattasNI
reviewed
Mar 8, 2024
angular-workspace/projects/ni/nimble-angular/src/directives/select/testing/select.pageobject.ts
Outdated
Show resolved
Hide resolved
rajsite
reviewed
Mar 8, 2024
jattasNI
reviewed
Mar 8, 2024
change/@ni-nimble-angular-07596cf2-5025-4bb7-8744-b44330dd560a.json
Outdated
Show resolved
Hide resolved
Co-authored-by: Jesse Attas <[email protected]>
jattasNI
approved these changes
Mar 12, 2024
rajsite
approved these changes
Mar 12, 2024
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.
Pull Request
🤨 Rationale
👩💻 Implementation
NimbleListOptionDirection
to support the placeholder use-casenimble-list-options
dynamically to the Angular template contents, followed immediately with setting a form value (that theSelect
was bound to) to the dynamically added option's value. This results in situation where theSelectControlValueAccessor
processes the set value (which for theSelect
requires that option to be present on the web component side) prior to theSelect
adding the option to its set, which would result in theSelect
view ignoring that value and setting it to empty string instead.connectedCallback
override of theNimbleListOption
to allow it to have its parent, through an available interface if implemented, process it. All theSelect
does, is if the option isn't already part of itsoptions
, it simply pushes it on to it. There is no concern with this interfering with the normal process of the option being added as part of theslottedOptionsChanged
callback, that will simply result in overwriting the options (which is fine).SelectPageObject
from Angular, so that we can also leverage it in SLE as needed. Removed a lot of unnecessaryasync
aspects of theSelectPageObject
public methods.🧪 Testing
Added unit tests in nimble-components for the new internal interface the
Select
is using. Added the boilerplate unit tests in Angular for the new attributes. Also added a couple of Angular tests one of which is representative of the original failing scenario from the integration effort (and the other is more for completion).✅ Checklist