@brightspace-ui/core 1.233.9 → 1.234.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -280,7 +280,7 @@ To make your usage of `d2l-dropdown-more` accessible, use the following property
280
280
  ![screenshot the basic dropdown-menu](./screenshots/dropdown-menu.png)
281
281
  <!-- docs: end hidden content -->
282
282
 
283
- <!-- docs: demo live name:d2l-dropdown-menu align:flex-start autoOpen:true autoSize:false size:medium -->
283
+ <!-- docs: demo live name:d2l-dropdown-menu align:flex-start autoSize:false size:medium -->
284
284
  ```html
285
285
  <script type="module">
286
286
  import '@brightspace-ui/core/components/dropdown/dropdown-button.js';
@@ -291,7 +291,7 @@ To make your usage of `d2l-dropdown-more` accessible, use the following property
291
291
  import '@brightspace-ui/core/components/tabs/tab-panel.js';
292
292
  </script>
293
293
  <d2l-dropdown-button text="Open!" primary>
294
- <d2l-dropdown-menu>
294
+ <d2l-dropdown-menu opened>
295
295
  <d2l-menu label="Astronomy">
296
296
  <d2l-menu-item text="Introduction"></d2l-menu-item>
297
297
  <d2l-menu-item text="Searching for the Heavens "></d2l-menu-item>
@@ -20,12 +20,15 @@ class DropdownMenu extends ThemeMixin(DropdownContentMixin(LitElement)) {
20
20
  super();
21
21
  this.noAutoFocus = true;
22
22
  this.noPadding = true;
23
+ this._initiallyOpenedSuppressFocus = false;
23
24
  this._maxHeightNonTray = this.maxHeight;
24
25
  }
25
26
 
26
27
  firstUpdated(changedProperties) {
27
28
  super.firstUpdated(changedProperties);
28
29
 
30
+ if (this.opened) this._initiallyOpenedSuppressFocus = true;
31
+
29
32
  this._maxHeightNonTray = this.maxHeight;
30
33
  if (this._useMobileStyling && this.mobileTray) {
31
34
  this.maxHeight = null;
@@ -114,7 +117,9 @@ class DropdownMenu extends ThemeMixin(DropdownContentMixin(LitElement)) {
114
117
 
115
118
  menu.resize();
116
119
 
117
- menu.focus();
120
+ // If dropdown-menu is opened on first render, do not focus
121
+ if (this._initiallyOpenedSuppressFocus) this._initiallyOpenedSuppressFocus = false;
122
+ else menu.focus();
118
123
  }
119
124
 
120
125
  _onSelect(e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "1.233.9",
3
+ "version": "1.234.0",
4
4
  "description": "A collection of accessible, free, open-source web components for building Brightspace applications",
5
5
  "type": "module",
6
6
  "repository": "https://github.com/BrightspaceUI/core.git",