MCPcopy Create free account
hub / github.com/angular/components / open

Method open

src/aria/private/menu/menu.ts:873–894  ·  view source on GitHub ↗

Opens the submenu.

(opts?: {first?: boolean; last?: boolean})

Source from the content-addressed store, hash-verified

871
872 /** Opens the submenu. */
873 open(opts?: {first?: boolean; last?: boolean}) {
874 if (this.disabled()) {
875 return;
876 }
877
878 this._expanded.set(true);
879
880 const submenu = this.submenu();
881 const items = submenu?.items();
882
883 if (submenu && items?.length) {
884 if (opts?.first) {
885 submenu.first();
886 } else if (opts?.last) {
887 submenu.last();
888 }
889 } else if (opts?.first) {
890 this.pendingFocus.set('first');
891 } else if (opts?.last) {
892 this.pendingFocus.set('last');
893 }
894 }
895
896 /** Closes the submenu. */
897 close(opts: {refocus?: boolean} = {}) {

Callers

nothing calls this directly

Calls 4

setMethod · 0.80
disabledMethod · 0.45
firstMethod · 0.45
lastMethod · 0.45

Tested by

no test coverage detected