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

Method open

src/aria/private/menu/menu.ts:882–903  ·  view source on GitHub ↗

Opens the submenu.

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

Source from the content-addressed store, hash-verified

880
881 /** Opens the submenu. */
882 open(opts?: {first?: boolean; last?: boolean}) {
883 if (this.disabled()) {
884 return;
885 }
886
887 this._expanded.set(true);
888
889 const submenu = this.submenu();
890 const items = submenu?.items();
891
892 if (submenu && items?.length) {
893 if (opts?.first) {
894 submenu.first();
895 } else if (opts?.last) {
896 submenu.last();
897 }
898 } else if (opts?.first) {
899 this.pendingFocus.set('first');
900 } else if (opts?.last) {
901 this.pendingFocus.set('last');
902 }
903 }
904
905 /** Closes the submenu. */
906 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