@atlassian/aui 9.3.16 → 9.3.17

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@atlassian/aui",
3
3
  "description": "Atlassian User Interface library",
4
- "version": "9.3.16",
4
+ "version": "9.3.17",
5
5
  "author": "Atlassian Pty Ltd.",
6
6
  "homepage": "https://aui.atlassian.com",
7
7
  "license": "Apache-2.0",
@@ -35,8 +35,27 @@ function setDropdownTriggerActiveState(trigger, isActive) {
35
35
  * @param {Event} [e] - the event that triggered the dropdown being shown
36
36
  */
37
37
  function handleFocus(dropdown, e = {}) {
38
- const mouseEvent = e && e.type && (e.type.indexOf('mouse') > -1 || e.type.indexOf('hover') > -1);
39
- dropdown.isSubmenu && !mouseEvent ? dropdown.focusItem(0) : dropdown.focus();
38
+ if (e && e.type) {
39
+ const isMouseEvent = e.type.indexOf('mouse') > -1 || e.type.indexOf('hover') > -1;
40
+ const isKeyDownEvent = e.type.indexOf('key') > -1;
41
+ if (dropdown.isSubmenu) {
42
+ !isMouseEvent ? dropdown.focusItem(0) : dropdown.focus();
43
+ } else if (isKeyDownEvent){
44
+ const isUpArrow = e.keyCode === keyCode.UP;
45
+ // set focus to last item in the menu to navigate bottom -> up
46
+ if (isUpArrow) {
47
+ const visibleItems = getVisibleDropdownItems(dropdown);
48
+ if (visibleItems && visibleItems.length) {
49
+ dropdown.focusItem(visibleItems.length - 1);
50
+ }
51
+ } else {
52
+ // if enter/space/downArrow than focus goes to the first item
53
+ dropdown.focusItem(0);
54
+ }
55
+ } else {
56
+ dropdown.focus();
57
+ }
58
+ }
40
59
  }
41
60
 
42
61
  // LOADING STATES
@@ -261,7 +261,7 @@
261
261
  .make-it-fullscreen();
262
262
  }
263
263
 
264
- .aui-dialog2-content {
264
+ & .aui-dialog2-content {
265
265
  height: calc(~"100vh" - @header-footer-combined-height);
266
266
  max-height: none; // otherwise, the footer "creeps up" the dialog and takes up the available space.
267
267
  }