160 Commits

Author SHA1 Message Date
Craig Rogers
ca5f75094b
fix(menu): output menu item theme values 2025-04-02 13:30:50 +01:00
Material Web Team
29d6763dc3 fix(menu): export CloseReason
PiperOrigin-RevId: 723241587
2025-02-04 15:11:09 -08:00
Material Web Team
767d1f159e feat(menu): add menu padding tokens
PiperOrigin-RevId: 720643566
2025-01-28 11:14:13 -08:00
Copybara-Service
e15f47e1a2 Merge pull request #5689 from Pupix:main
PiperOrigin-RevId: 660400219
2024-08-07 08:29:55 -07:00
Pupix
6df7161d69 Allow users to disable surface flipping in md-menu
Sometimes the desired effect is to have the menu extend to the available height and then start overflowing instead of flipping to the opposite corner. Cases like search bar, autocomplete or any kind of input with suggestions below the textfield content.
2024-08-02 22:57:44 +02:00
Elizabeth Mitchell
55b4650063 fix(tokens)!: tokens.md-comp-*-values() include custom properties by default
BREAKING CHANGE: Sass component tokens, such as `tokens.md-comp-checkbox-values()`, return `var(--md-<component>, <value>)` instead of just the CSS value. Use `$exclude-custom-properties: true` to remove them.

PiperOrigin-RevId: 652550625
2024-07-15 11:43:52 -07:00
Elizabeth Mitchell
5df9410e60 fix!: aria-labels announcing twice with "group" on components
BREAKING CHANGE: `querySelector` for `[role]` and `[aria-*]` attributes may no longer work. See `@material/web/migrations/v2/README.md` and `@material/web/migrations/v2/query-selector-aria.ts`.

Browser/SR test results (go/mwc-double-aria-test-results)
  -  VoiceOver on Chrome
  -  VoiceOver on iOS Safari
  -  TalkBack on Chrome
  -  ChromeVox on Chrome
  -  NVDA on Chrome
  -  NVDA on Firefox
  -  JAWS on Chrome
  -  JAWS on Firefox
  (Optional)
  -  VoiceOver on Safari
  -  VoiceOver on Firefox

PiperOrigin-RevId: 648859827
2024-07-02 15:22:12 -07:00
Elliott Marquez
4f7ff4f63a fix(menu): resolve aborted animations as false rather than reject
fixes #5638

PiperOrigin-RevId: 642044142
2024-06-10 15:35:32 -07:00
Material Web Team
e1f9cbc59e fix(menu): getBoundingClientRect() and getClientRects() not working
PiperOrigin-RevId: 634601756
2024-05-16 19:12:29 -07:00
Elizabeth Mitchell
1bf8b5fbf9 feat(menu): allow customizing scrollbar-width
PiperOrigin-RevId: 629196509
2024-04-29 15:01:44 -07:00
Elizabeth Mitchell
c35bad0c64 fix: rename internal <styles>.css.js to <styles>.css
We are changing the names of these files to reduce similarity with CSS modules and avoid clashing with tooling built around that. If you're importing `*/internal/styles.css.js`, swap to `*/internal/styles.js`.

PiperOrigin-RevId: 611265000
2024-02-28 16:20:22 -08:00
Elizabeth Mitchell
c6ffd70fc8 feat(menu): add no-navigation-wrap to fix select accessibility
PiperOrigin-RevId: 610514684
2024-02-26 13:46:47 -08:00
Elizabeth Mitchell
ec0a8ebf6e chore: use CSSResultOrNative instead of CSSResult for static styles
PiperOrigin-RevId: 609760445
2024-02-23 10:01:56 -08:00
Elizabeth Mitchell
ce41b7bfb3 fix: use explicit CSSResult[] types for static styles
PiperOrigin-RevId: 609494809
2024-02-22 14:15:11 -08:00
Material Web Team
2049323dde fix(menu): left arrow in submenu closes submenu in closure
PiperOrigin-RevId: 608184142
2024-02-18 17:28:53 -08:00
Kaspar Papli
f0e78db6d2
docs: fix wording issue in submenu docs 2024-02-12 20:53:55 +01:00
Kaspar Papli
b1efe3222c
docs: fix typos and wording issues in menu docs 2024-02-12 20:51:37 +01:00
Elizabeth Mitchell
84536d7416 chore: update components to use custom properties from tokens
PiperOrigin-RevId: 601597083
2024-01-25 16:13:41 -08:00
Elizabeth Mitchell
86bd6f8309 fix(menu): --md-menu-item-container-color not working
This change removes the leftover md-comp-menu-list-item token set, which doesn't have a corresponding component. If you're using it, the correct token set to use is md-comp-menu-item.

As a side effect of the merge, it also added the missing menu item container-color token.

PiperOrigin-RevId: 601168134
2024-01-24 10:44:44 -08:00
Jan Kuehle
4b4c373a6b chore: use import and export types
PiperOrigin-RevId: 599338980
2024-01-17 17:39:46 -08:00
Copybara-Service
80edf15920 Merge pull request #5229 from aarondrabeck:md-menu-color-fix
PiperOrigin-RevId: 591297433
2023-12-15 10:37:44 -08:00
Elliott Marquez
c4cbd3612c fix(menu): shift tab into anchor closes menu
PiperOrigin-RevId: 589173373
2023-12-08 10:25:43 -08:00
Material Web Team
bd88880f78 fix(menu): escape not closing menus with submenus
Ensure pressing escape while on a closed submenu anchor, closes the parent menu

Previously we were not letting a user close a menu when they were focused on any item with keepOpen = true. This included submenu anchors.

This change adds an escape (hehe) hatch to ensure that even on items with keepOpen = true, escape closes the menu. This is what most users expect and is what is the standard on menus around the web.

PiperOrigin-RevId: 587874713
2023-12-04 16:22:47 -08:00
Elliott Marquez
aafea84115 docs(menu): set target to _blank in demos
PiperOrigin-RevId: 587866823
2023-12-04 15:52:45 -08:00
Elliott Marquez
af49b64ab4 feat(menu,select): allow menu and select typeahead to read default slot text content
PiperOrigin-RevId: 587864760
2023-12-04 15:45:18 -08:00
Elizabeth Mitchell
c319236cd1 refactor: remove Firefox ARIAMixin polyfills (v119+)
This is now fixed in the latest two versions of Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1785412

PiperOrigin-RevId: 586442947
2023-11-29 13:48:38 -08:00
Aaron Drabeck
063ac88a07 fix(menu): prevent default popover color from overriding menu surface 2023-11-29 10:47:07 -07:00
Material Web Team
3d8c7ac7f3 fix(menu): declare popover property type on HTMLElement
Without it the popover property got renamed by closure.

PiperOrigin-RevId: 584184281
2023-11-20 18:53:26 -08:00
Material Web Team
bf8d3f6289 fix(menu): declare popover API types
Without it show/hide popover get renamed by closure.

PiperOrigin-RevId: 582471354
2023-11-14 16:12:59 -08:00
Elliott Marquez
2adcb1479a docs: document events in jsdoc
PiperOrigin-RevId: 581041601
2023-11-09 15:25:21 -08:00
Elliott Marquez
7859b39afe feat(menu): add popover functionality
Uses popover API for browsers that support it. Falls back to fixed positioning on browsers that do not.

fixes #2023
fixes #5120

PiperOrigin-RevId: 580633646
2023-11-08 13:14:25 -08:00
Elliott Marquez
2b591ca759 feat(menu): add document-level positioning
related #5120

PiperOrigin-RevId: 580293404
2023-11-07 14:04:00 -08:00
Elizabeth Mitchell
f5daadc307 chore: update components to use mixinFocusable
PiperOrigin-RevId: 576982507
2023-10-26 14:09:08 -07:00
Elizabeth Mitchell
c390291687 chore: format files with prettier
PiperOrigin-RevId: 576601342
2023-10-25 11:59:00 -07:00
Elliott Marquez
863109e204 fix(menu): fix menu OOB from resizing window
fixes #5063

PiperOrigin-RevId: 574286021
2023-10-17 15:42:11 -07:00
Material Web Team
4b00a9561c fix(list): list items will not escape their parent when parent width is restricted
PiperOrigin-RevId: 572988261
2023-10-12 12:59:19 -07:00
Elliott Marquez
8bbb4b4fff fix(menu): fix menu tapping behaviors on iOS and do not close on anchor click
fixes #5036
fixes #5015

iOS has some really bad behaviors when it comes to clicking and focus. clicking on the body on a non-clickable item (like anything outside a menu) does not tirgger a click event that bubbles to menu. Also, clicking on a button does not cause it to be focused, thus depriving us of information on focusout's related target. Therefore we have to assume the anchor is the trigger.

PiperOrigin-RevId: 572137765
2023-10-09 22:35:02 -07:00
Elizabeth Mitchell
c9aadeb585 chore(menu): merge HCM styles
PiperOrigin-RevId: 571239710
2023-10-05 23:28:28 -07:00
Elliott Marquez
8ae8c02866 fix(menu,select): enter clicks href items
PiperOrigin-RevId: 571104363
2023-10-05 12:55:39 -07:00
Elliott Marquez
d6f7220f0b fix(menu): fix submenu SSR left keyboard close navigation
PiperOrigin-RevId: 569664658
2023-09-29 21:44:51 -07:00
Elliott Marquez
c346f5b977 build: visibility changes
PiperOrigin-RevId: 569032710
2023-09-27 19:46:00 -07:00
Elliott Marquez
73eb15ebee fix(menu): fix menu item fade in order animation
fixes #5014

PiperOrigin-RevId: 568949388
2023-09-27 13:47:41 -07:00
Elliott Marquez
d27ef2e059 fix(menu): expose item custom properties and fix selected color
PiperOrigin-RevId: 568344744
2023-09-25 15:47:19 -07:00
Elizabeth Mitchell
682a39c480 chore(menu): update demo a11y
PiperOrigin-RevId: 568337321
2023-09-25 15:16:42 -07:00
Elliott Marquez
aeb5103e1c fix(menu,select): fix final aria issues
PiperOrigin-RevId: 568326002
2023-09-25 14:31:52 -07:00
Elliott Marquez
6d0c7e8538 refactor(list)!: refactor list to reuse ListController
fixes #4967

also fixes list-root focus ring and focusout

BREAKING CHANGE: the new ListController behavior no longer waits for event.preventDefault asynchronously because it was causing keyboard navigations to scroll the page.

PiperOrigin-RevId: 568300155
2023-09-25 12:54:12 -07:00
Elliott Marquez
5e4434bfed fix(select): update select docs and fix initial selection
PiperOrigin-RevId: 567884899
2023-09-23 11:14:56 -07:00
Elliott Marquez
f81ce1131b refactor(select): refactor select so that it doesn't rely on menuitem & use logic controller
PiperOrigin-RevId: 567735675
2023-09-22 15:45:50 -07:00
Elizabeth Mitchell
b35212a9ac feat(items): add <md-item> to @material/web/labs
PiperOrigin-RevId: 567734991
2023-09-22 15:42:42 -07:00
Elliott Marquez
5fad4f088f feat(menu): create a Menu interface for easier md-menu wrapping
PiperOrigin-RevId: 567728911
2023-09-22 15:15:41 -07:00