fix(cdk/listbox): error with multiple preselected values#25621
Merged
crisbeto merged 1 commit intoangular:mainfrom Sep 11, 2022
Merged
fix(cdk/listbox): error with multiple preselected values#25621crisbeto merged 1 commit intoangular:mainfrom
crisbeto merged 1 commit intoangular:mainfrom
Conversation
The CDK listbox had a subscription to its model changes in the constructor which fires immediately due to the `startsWith` and which was attempting to sort the selected values when in multiple selection mode. The problem is that the options aren't available until `ngAfterContentInit` which was causing an error when we tried to do the sorting. These changes move the change event subscription to `ngAfterContentInit` so that options are guaranteed to be defined when it fires. Fixes angular#25611.
crisbeto
commented
Sep 10, 2022
| })); | ||
|
|
||
| it('should respect user given tabindex for focusable elements', async () => { | ||
| it('should respect user given tabindex for focusable elements', waitForAsync(async () => { |
Member
Author
There was a problem hiding this comment.
I added waitForAsync to all of these tests, because any errors during the test weren't being picked up by Jasmine. This threw me off for a while since I could see that an error was being thrown, but my test wasn't failing.
crisbeto
added a commit
that referenced
this pull request
Sep 11, 2022
The CDK listbox had a subscription to its model changes in the constructor which fires immediately due to the `startsWith` and which was attempting to sort the selected values when in multiple selection mode. The problem is that the options aren't available until `ngAfterContentInit` which was causing an error when we tried to do the sorting. These changes move the change event subscription to `ngAfterContentInit` so that options are guaranteed to be defined when it fires. Fixes #25611. (cherry picked from commit 1b0265c)
forsti0506
pushed a commit
to forsti0506/components
that referenced
this pull request
Sep 16, 2022
The CDK listbox had a subscription to its model changes in the constructor which fires immediately due to the `startsWith` and which was attempting to sort the selected values when in multiple selection mode. The problem is that the options aren't available until `ngAfterContentInit` which was causing an error when we tried to do the sorting. These changes move the change event subscription to `ngAfterContentInit` so that options are guaranteed to be defined when it fires. Fixes angular#25611.
crapStone
pushed a commit
to Calciumdibromid/CaBr2
that referenced
this pull request
Sep 22, 2022
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@angular/cdk](https://github.com/angular/components) | dependencies | patch | [`14.2.1` -> `14.2.2`](https://renovatebot.com/diffs/npm/@angular%2fcdk/14.2.1/14.2.2) | | [@angular/material](https://github.com/angular/components) | dependencies | patch | [`14.2.1` -> `14.2.2`](https://renovatebot.com/diffs/npm/@angular%2fmaterial/14.2.1/14.2.2) | --- ### Release Notes <details> <summary>angular/components</summary> ### [`v14.2.2`](https://github.com/angular/components/blob/HEAD/CHANGELOG.md#​1422-cytoplasm-salmon-2022-09-14) [Compare Source](angular/components@14.2.1...14.2.2) ##### cdk | Commit | Type | Description | | -- | -- | -- | | [6275f9d41f](angular/components@6275f9d) | fix | **a11y:** account for Windows 11 high contrast themes in detector ([#​25624](angular/components#25624)) | | [eb5f79bb7b](angular/components@eb5f79b) | fix | **listbox:** error with multiple preselected values ([#​25621](angular/components#25621)) | | [65af24ee53](angular/components@65af24e) | fix | **menu:** don't prevent default enter and space actions ([#​25591](angular/components#25591)) | ##### material | Commit | Type | Description | | -- | -- | -- | | [b3e35f3be4](angular/components@b3e35f3) | fix | **datepicker:** restore focus after closing animation ([#​25567](angular/components#25567)) | #### Special Thanks Kristiyan Kostadinov and Paul Gschwendtner <!-- CHANGELOG SPLIT MARKER --> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xOTUuMyIsInVwZGF0ZWRJblZlciI6IjMyLjE5Ni4wIn0=--> Co-authored-by: cabr2-bot <cabr2.help@gmail.com> Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1547 Reviewed-by: Epsilon_02 <epsilon_02@noreply.codeberg.org> Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org> Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The CDK listbox had a subscription to its model changes in the constructor which fires immediately due to the
startsWithand which was attempting to sort the selected values when in multiple selection mode. The problem is that the options aren't available untilngAfterContentInitwhich was causing an error when we tried to do the sorting.These changes move the change event subscription to
ngAfterContentInitso that options are guaranteed to be defined when it fires.Fixes #25611.