@instructure/ui-buttons 10.19.1-snapshot-4 → 10.19.2-snapshot-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.
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [10.19.
|
|
6
|
+
## [10.19.2-snapshot-0](https://github.com/instructure/instructure-ui/compare/v10.19.1...v10.19.2-snapshot-0) (2025-06-06)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **ui-buttons:** make Button have a focus ring in Safari ([54118ac](https://github.com/instructure/instructure-ui/commit/54118ac22f3745c7b34f4da9d1c857951c63f8df))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [10.19.1](https://github.com/instructure/instructure-ui/compare/v10.19.0...v10.19.1) (2025-06-05)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @instructure/ui-buttons
|
|
9
20
|
|
package/es/BaseButton/index.js
CHANGED
|
@@ -32,6 +32,7 @@ import { getElementType, getInteraction, passthroughProps, callRenderProp } from
|
|
|
32
32
|
import { isActiveElement } from '@instructure/ui-dom-utils';
|
|
33
33
|
import { hasVisibleChildren } from '@instructure/ui-a11y-utils';
|
|
34
34
|
import { View } from '@instructure/ui-view';
|
|
35
|
+
import { isSafari } from '@instructure/ui-utils';
|
|
35
36
|
import { withStyle } from '@instructure/emotion';
|
|
36
37
|
import generateStyles from './styles';
|
|
37
38
|
import generateComponentTheme from './theme';
|
|
@@ -227,7 +228,8 @@ let BaseButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec
|
|
|
227
228
|
}
|
|
228
229
|
}
|
|
229
230
|
let tabIndexValue = tabIndex;
|
|
230
|
-
|
|
231
|
+
// In Safari, a button cannot get focus unless it has an explicit 0 tabindex
|
|
232
|
+
if (onClick && as && needsZeroTabIndex || isSafari() && as) {
|
|
231
233
|
tabIndexValue = tabIndex || 0;
|
|
232
234
|
}
|
|
233
235
|
return _jsx(View, {
|
package/lib/BaseButton/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js
|
|
|
16
16
|
var _isActiveElement = require("@instructure/ui-dom-utils/lib/isActiveElement.js");
|
|
17
17
|
var _hasVisibleChildren = require("@instructure/ui-a11y-utils/lib/hasVisibleChildren.js");
|
|
18
18
|
var _View = require("@instructure/ui-view/lib/View");
|
|
19
|
+
var _uiUtils = require("@instructure/ui-utils");
|
|
19
20
|
var _emotion = require("@instructure/emotion");
|
|
20
21
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
21
22
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
@@ -236,7 +237,8 @@ let BaseButton = exports.BaseButton = (_dec = (0, _emotion.withStyle)(_styles.de
|
|
|
236
237
|
}
|
|
237
238
|
}
|
|
238
239
|
let tabIndexValue = tabIndex;
|
|
239
|
-
|
|
240
|
+
// In Safari, a button cannot get focus unless it has an explicit 0 tabindex
|
|
241
|
+
if (onClick && as && needsZeroTabIndex || (0, _uiUtils.isSafari)() && as) {
|
|
240
242
|
tabIndexValue = tabIndex || 0;
|
|
241
243
|
}
|
|
242
244
|
return (0, _jsxRuntime.jsx)(_View.View, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-buttons",
|
|
3
|
-
"version": "10.19.
|
|
3
|
+
"version": "10.19.2-snapshot-0",
|
|
4
4
|
"description": "Accessible button components",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-axe-check": "10.19.
|
|
27
|
-
"@instructure/ui-babel-preset": "10.19.
|
|
28
|
-
"@instructure/ui-test-utils": "10.19.
|
|
29
|
-
"@instructure/ui-themes": "10.19.
|
|
26
|
+
"@instructure/ui-axe-check": "10.19.2-snapshot-0",
|
|
27
|
+
"@instructure/ui-babel-preset": "10.19.2-snapshot-0",
|
|
28
|
+
"@instructure/ui-test-utils": "10.19.2-snapshot-0",
|
|
29
|
+
"@instructure/ui-themes": "10.19.2-snapshot-0",
|
|
30
30
|
"@testing-library/jest-dom": "^6.6.3",
|
|
31
31
|
"@testing-library/react": "^16.0.1",
|
|
32
32
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -34,21 +34,21 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@babel/runtime": "^7.26.0",
|
|
37
|
-
"@instructure/console": "10.19.
|
|
38
|
-
"@instructure/emotion": "10.19.
|
|
39
|
-
"@instructure/shared-types": "10.19.
|
|
40
|
-
"@instructure/ui-a11y-content": "10.19.
|
|
41
|
-
"@instructure/ui-a11y-utils": "10.19.
|
|
42
|
-
"@instructure/ui-color-utils": "10.19.
|
|
43
|
-
"@instructure/ui-dom-utils": "10.19.
|
|
44
|
-
"@instructure/ui-icons": "10.19.
|
|
45
|
-
"@instructure/ui-position": "10.19.
|
|
46
|
-
"@instructure/ui-prop-types": "10.19.
|
|
47
|
-
"@instructure/ui-react-utils": "10.19.
|
|
48
|
-
"@instructure/ui-testable": "10.19.
|
|
49
|
-
"@instructure/ui-tooltip": "10.19.
|
|
50
|
-
"@instructure/ui-utils": "10.19.
|
|
51
|
-
"@instructure/ui-view": "10.19.
|
|
37
|
+
"@instructure/console": "10.19.2-snapshot-0",
|
|
38
|
+
"@instructure/emotion": "10.19.2-snapshot-0",
|
|
39
|
+
"@instructure/shared-types": "10.19.2-snapshot-0",
|
|
40
|
+
"@instructure/ui-a11y-content": "10.19.2-snapshot-0",
|
|
41
|
+
"@instructure/ui-a11y-utils": "10.19.2-snapshot-0",
|
|
42
|
+
"@instructure/ui-color-utils": "10.19.2-snapshot-0",
|
|
43
|
+
"@instructure/ui-dom-utils": "10.19.2-snapshot-0",
|
|
44
|
+
"@instructure/ui-icons": "10.19.2-snapshot-0",
|
|
45
|
+
"@instructure/ui-position": "10.19.2-snapshot-0",
|
|
46
|
+
"@instructure/ui-prop-types": "10.19.2-snapshot-0",
|
|
47
|
+
"@instructure/ui-react-utils": "10.19.2-snapshot-0",
|
|
48
|
+
"@instructure/ui-testable": "10.19.2-snapshot-0",
|
|
49
|
+
"@instructure/ui-tooltip": "10.19.2-snapshot-0",
|
|
50
|
+
"@instructure/ui-utils": "10.19.2-snapshot-0",
|
|
51
|
+
"@instructure/ui-view": "10.19.2-snapshot-0",
|
|
52
52
|
"keycode": "^2",
|
|
53
53
|
"prop-types": "^15.8.1"
|
|
54
54
|
},
|
package/src/BaseButton/index.tsx
CHANGED
|
@@ -36,6 +36,7 @@ import { isActiveElement } from '@instructure/ui-dom-utils'
|
|
|
36
36
|
import { hasVisibleChildren } from '@instructure/ui-a11y-utils'
|
|
37
37
|
import { View } from '@instructure/ui-view'
|
|
38
38
|
import type { ViewProps } from '@instructure/ui-view'
|
|
39
|
+
import { isSafari } from '@instructure/ui-utils'
|
|
39
40
|
|
|
40
41
|
import { withStyle } from '@instructure/emotion'
|
|
41
42
|
|
|
@@ -279,7 +280,8 @@ class BaseButton extends Component<BaseButtonProps> {
|
|
|
279
280
|
}
|
|
280
281
|
}
|
|
281
282
|
let tabIndexValue = tabIndex
|
|
282
|
-
|
|
283
|
+
// In Safari, a button cannot get focus unless it has an explicit 0 tabindex
|
|
284
|
+
if ((onClick && as && needsZeroTabIndex) || (isSafari() && as)) {
|
|
283
285
|
tabIndexValue = tabIndex || 0
|
|
284
286
|
}
|
|
285
287
|
return (
|