@vaadin/vaadin-control-state-mixin
Advanced tools
Comparing version 2.1.2 to 2.1.3
@@ -13,3 +13,3 @@ { | ||
"name": "@vaadin/vaadin-control-state-mixin", | ||
"version": "2.1.2", | ||
"version": "2.1.3", | ||
"main": "vaadin-control-state-mixin.js", | ||
@@ -31,3 +31,3 @@ "author": "Vaadin Ltd", | ||
"devDependencies": { | ||
"@polymer/iron-test-helpers": "^3.0.0-pre.18", | ||
"@polymer/iron-test-helpers": "^3.0.0", | ||
"wct-browser-legacy": "^1.0.1", | ||
@@ -34,0 +34,0 @@ "@webcomponents/webcomponentsjs": "^2.0.0" |
@@ -9,22 +9,17 @@ [![npm version](https://badgen.net/npm/v/@vaadin/vaadin-control-state-mixin)](https://www.npmjs.com/package/@vaadin/vaadin-control-state-mixin) | ||
## Contributing | ||
## Running tests in browser | ||
1. Fork the `vaadin-control-state-mixin` repository and clone it locally. | ||
1. Make sure you have [npm](https://www.npmjs.com/) installed. | ||
1. Make sure you have [npm](https://www.npmjs.com/) and [Bower](https://bower.io) installed. | ||
1. When in the `vaadin-control-state-mixin` directory, run `npm install` to install dependencies. | ||
1. When in the `vaadin-control-state-mixin` directory, run `npm install` and then `bower install` to install dependencies. | ||
1. Make sure you have [polymer-cli](https://www.npmjs.com/package/polymer-cli) installed globally: `npm i -g polymer-cli`. | ||
## Running tests in browser | ||
1. Run `npm start`. | ||
1. Install [polyserve](https://www.npmjs.com/package/polyserve): `npm install -g polyserve` | ||
1. Navigate to http://127.0.0.1:3000/components/vaadin-control-state-mixin/test/index.html | ||
1. When in the `vaadin-control-state-mixin` directory, run `polyserve --open`, browser will automatically open the component API documentation. | ||
1. You can also open in-browser tests by adding **test** to the URL, for example: | ||
- http://127.0.0.1:8080/components/vaadin-control-state-mixin/test/index.html | ||
## Running tests from the command line | ||
@@ -44,6 +39,3 @@ | ||
- Make sure your code is compliant with our code linters: `gulp lint` | ||
- Check that tests are passing: `npm test` | ||
- [Submit a pull request](https://www.digitalocean.com/community/tutorials/how-to-create-a-pull-request-on-github) with detailed title and description | ||
- Wait for response from one of Vaadin Elements team members | ||
To contribute to the component, please read [the guideline](https://github.com/vaadin/vaadin-core/blob/master/CONTRIBUTING.md) first. | ||
@@ -50,0 +42,0 @@ |
@@ -105,9 +105,32 @@ /** | ||
this.addEventListener('keydown', e => { | ||
if (!e.defaultPrevented && e.shiftKey && e.keyCode === 9) { | ||
// Flag is checked in _focus event handler. | ||
this._isShiftTabbing = true; | ||
HTMLElement.prototype.focus.apply(this); | ||
this._setFocused(false); | ||
// Event handling in IE is asynchronous and the flag is removed asynchronously as well | ||
setTimeout(() => this._isShiftTabbing = false, 0); | ||
if (!e.defaultPrevented && e.keyCode === 9) { | ||
if (e.shiftKey) { | ||
// Flag is checked in _focus event handler. | ||
this._isShiftTabbing = true; | ||
HTMLElement.prototype.focus.apply(this); | ||
this._setFocused(false); | ||
// Event handling in IE is asynchronous and the flag is removed asynchronously as well | ||
setTimeout(() => this._isShiftTabbing = false, 0); | ||
} else { | ||
// Workaround for FF63-65 bug that causes the focus to get lost when | ||
// blurring a slotted component with focusable shadow root content | ||
// https://bugzilla.mozilla.org/show_bug.cgi?id=1528686 | ||
// TODO: Remove when safe | ||
const firefox = window.navigator.userAgent.match(/Firefox\/(\d\d\.\d)/); | ||
if (firefox | ||
&& parseFloat(firefox[1]) >= 63 | ||
&& parseFloat(firefox[1]) < 66 | ||
&& this.parentNode | ||
&& this.nextSibling) { | ||
const fakeTarget = document.createElement('input'); | ||
fakeTarget.style.position = 'absolute'; | ||
fakeTarget.style.opacity = 0; | ||
fakeTarget.tabIndex = this.tabIndex; | ||
this.parentNode.insertBefore(fakeTarget, this.nextSibling); | ||
fakeTarget.focus(); | ||
fakeTarget.addEventListener('focusout', () => this.parentNode.removeChild(fakeTarget)); | ||
} | ||
} | ||
} | ||
@@ -251,2 +274,11 @@ }); | ||
} | ||
/** | ||
* @protected | ||
*/ | ||
click() { | ||
if (!this.disabled) { | ||
super.click(); | ||
} | ||
} | ||
}; |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
37141
252
0
44