Skip to content

Commit

Permalink
docs(api): correct information about how ids are generated
Browse files Browse the repository at this point in the history
  • Loading branch information
NickDJM authored May 8, 2024
1 parent 80a7697 commit cbc4b68
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions docs/api/base-menu-toggle.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ BaseMenuToggle._setIds();

If the toggle and controlled menu do not have IDs, the following steps take place:

- Generate a random 10 character string,
- Generate a random string 1-10 characters long,
- Get the innerText of the toggle,
- Set the toggle's ID to: `${toggle-inner-text}-${the-random-string}-menu-button`
- Set the menu's ID to: `${toggle-inner-text}-${the-random-string}-menu`
- Set the toggle's ID to: `menu-button-${toggle-inner-text}-${the-random-string}`
- Set the menu's ID to: `menu-${toggle-inner-text}-${the-random-string}`

### _setAriaAttributes <badge type="warning" text="protected" /> {#method--setAriaAttributes}

Expand Down
6 changes: 3 additions & 3 deletions src/_baseMenuToggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ class BaseMenuToggle {
* Sets unique IDs for the toggle and controlled menu.
*
* If the toggle and controlled menu do not have IDs, the following steps take place:
* - Generate a random 10 character string,
* - Generate a random string 1-10 characters long,
* - Get the innerText of the toggle,
* - Set the toggle's ID to: `${toggle-inner-text}-${the-random-string}-menu-button`
* - Set the menu's ID to: `${toggle-inner-text}-${the-random-string}-menu`
* - Set the toggle's ID to: `menu-button-${toggle-inner-text}-${the-random-string}`
* - Set the menu's ID to: `menu-${toggle-inner-text}-${the-random-string}`
*
* @protected
*/
Expand Down

0 comments on commit cbc4b68

Please sign in to comment.