Uh oh!
There was an error while loading. Please reload this page.
fix(menu): keyboard controls not respecting DOM order when items are added at a later point - #11720
Conversation
| ngAfterContentInit() { | ||
| this._keyManager = new FocusKeyManager<MatMenuItem>(this._items).withWrap().withTypeAhead(); | ||
| this._allItems.changes |
There was a problem hiding this comment.
Add comment here that explains what you're doing (collecting direct descendants) and why they're needed? Might also be good to break this out into its own method like _updateDirectDescendants
fcfef34 to
7b64465Comparecrisbeto
commented
Jun 29, 2018
Addressed the feedback. |
jelbourn
commented
Aug 26, 2018
@crisbeto github shows this PR as having no conflicts, but our presubmit script thinks it does. Could you rebase it? |
7b64465 to
1276018Comparecrisbeto
commented
Aug 26, 2018
Done. |
Hi @crisbeto! This PR has merge conflicts due to recent upstream merges. |
1276018 to
03b01ecCompare| /** | ||
| * @deprecated To be removed. | ||
| * @deletion-target 8.0.0 |
There was a problem hiding this comment.
| * @deletion-target8.0.0 | |
| * @breaking-change8.0.0 |
There are two lint failures for removeItem and addItem
03b01ec to
91e67fcComparedmk1111
commented
Dec 12, 2018
Hi @devversion@jelbourn@crisbeto ! Thanks! |
91e67fc to
2fd886aComparescriby
commented
Jan 16, 2019
I hit this bug today (working on a Google product at Google) |
7cdd32a to
2eb0545Compare9f5ef98 to
410fc9dComparemmalerba
commented
Mar 13, 2019
there are some internal apps that need to be cleaned up before this can be merged |
410fc9d to
e431613Compareandrewseguin
commented
Jul 8, 2019
@crisbeto Can you check out the test failures? I'm working with a team internally to fix a test so we can get this merged |
…added at a later point A while ago we reworked the menu not to pick up the items of other child menus. As a result, we had to use a custom way of registering and de-registering the menu items, however that method ends up adding any newly-created items to the end of the item list. This will throw off the keyboard navigation if an item is inserted in the beginning or the middle of the list. With these changes we switch to picking up the items using `ContentChildren` and filtering out all of the indirect descendants. Fixesangular#11652.
e431613 to
243bd2fComparecrisbeto
commented
Jul 8, 2019
Fixed @andrewseguin. Looks like there were some breaking changes in 8.0 I hadn't accounted for. |
…ems are added at a later point (angular#11720)" This reverts commit 49e8c59.
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. |
A while ago we reworked the menu not to pick up the items of other child menus. As a result, we had to use a custom way of registering and de-registering the menu items, however that method ends up adding any newly-created items to the end of the item list. This will throw off the keyboard navigation if an item is inserted in the beginning or the middle of the list. With these changes we switch to picking up the items using
ContentChildrenand filtering out all of the indirect descendants.Fixes#11652.