@spectrum-css/actionbutton
Advanced tools
Comparing version 1.0.8 to 1.0.9
@@ -6,2 +6,12 @@ # Change Log | ||
<a name="1.0.9"></a> | ||
## 1.0.9 | ||
🗓 2021-11-16 • 📝 [Commits](https://github.com/adobe/spectrum-css/compare/@spectrum-css/actionbutton@1.0.8...@spectrum-css/actionbutton@1.0.9) | ||
**Note:** Version bump only for package @spectrum-css/actionbutton | ||
<a name="1.0.8"></a> | ||
@@ -8,0 +18,0 @@ ## 1.0.8 |
@@ -99,9 +99,28 @@ /* | ||
(function() { | ||
function setFocus(inputgroup, input, focused) { | ||
var focusClass = input.classList.contains('focus-ring') ? 'is-keyboardFocused' : 'is-focused'; | ||
function setFocus(inputgroup, focused, event) { | ||
var textfields = inputgroup.querySelectorAll('.spectrum-Textfield'); | ||
var inputs = inputgroup.querySelectorAll('.spectrum-InputGroup-input'); | ||
var input = inputs[0]; | ||
var focusClass = event.target.classList.contains('focus-ring') ? 'is-keyboardFocused' : 'is-focused'; | ||
var pickerButton = inputgroup.querySelector('.spectrum-PickerButton'); | ||
if (focused) { | ||
inputgroup.classList.add(focusClass); | ||
pickerButton.classList.add(focusClass); | ||
if (event.target.tagName !== 'INPUT') { | ||
input.focus(); | ||
} | ||
Array.prototype.forEach.call(textfields, (textfield) => { | ||
textfield.classList.add(focusClass); | ||
}); | ||
} else { | ||
pickerButton.classList.remove('is-keyboardFocused'); | ||
pickerButton.classList.remove('is-focused'); | ||
inputgroup.classList.remove('is-keyboardFocused'); | ||
inputgroup.classList.remove('is-focused'); | ||
Array.prototype.forEach.call(textfields, (textfield) => { | ||
textfield.classList.remove('is-focused'); | ||
textfield.classList.remove('is-keyboardFocused'); | ||
}); | ||
} | ||
@@ -113,4 +132,9 @@ } | ||
if (event.target.closest('.spectrum-Menu')) { | ||
// Don't mess with focus on menuitems | ||
return; | ||
} | ||
if (inputgroup) { | ||
setFocus(inputgroup, event.target, true); | ||
setFocus(inputgroup, true, event); | ||
} | ||
@@ -123,3 +147,3 @@ }); | ||
if (inputgroup) { | ||
setFocus(inputgroup, event.target, false); | ||
setFocus(inputgroup, false, event); | ||
} | ||
@@ -126,0 +150,0 @@ }); |
@@ -20,3 +20,3 @@ /* | ||
<form class="spectrum-Search js-form" role="combobox" aria-expanded="false" aria-owns="search-results-listbox" aria-haspopup="listbox"> | ||
<div class="spectrum-Textfield"> | ||
<div class="spectrum-Textfield spectrum-Search-textfield"> | ||
<svg class="spectrum-Icon spectrum-Icon--sizeM spectrum-Textfield-icon spectrum-Search-icon" focusable="false" aria-hidden="true"> | ||
@@ -23,0 +23,0 @@ <use xlink:href="#spectrum-icon-18-Magnify" /> |
{ | ||
"name": "@spectrum-css/actionbutton", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "The Spectrum CSS action button component", | ||
@@ -22,5 +22,5 @@ "license": "Apache-2.0", | ||
"devDependencies": { | ||
"@spectrum-css/component-builder": "^3.0.0", | ||
"@spectrum-css/icon": "^3.0.8", | ||
"@spectrum-css/vars": "^4.2.0", | ||
"@spectrum-css/component-builder": "^3.0.1", | ||
"@spectrum-css/icon": "^3.0.9", | ||
"@spectrum-css/vars": "^4.3.0", | ||
"gulp": "^4.0.0" | ||
@@ -32,3 +32,3 @@ }, | ||
"homepage": "https://opensource.adobe.com/spectrum-css/", | ||
"gitHead": "2f7969a8d40a0e155ae4f9f11185d0b4b6140da0" | ||
"gitHead": "2ece55450590431ce4f529cc3b3bf1b28d48a807" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2668518
6415