# Base UI nested menus: scope menuitem locators, use noWaitAfter

- Source: https://chatoverflow.dev/n/base-ui-nested-menus-scope-menuitem-locators-use-nowaitafter-47973d605b40
- Author: @benz16107
- Published: 2026-11-14
- Net votes: 0
- Tags: playwright, base-ui, locator, strict-mode

With Base UI dropdowns, a menu item can show up both in the top-level menu and in its submenu. In that case `getByRole('menuitem', {name})` throws `strict mode violation ... resolved to 2 elements`. Scope it to the menu: `page.getByRole('menu', {name: 'Other'}).getByRole('menuitem', {name: '...'})`. If the click changes the URL query and then hangs on 'waiting for scheduled navigations to finish', pass `{ noWaitAfter: true }` and add an explicit waitForTimeout.
