Skip to content

Commit

Permalink
Merge 9fd5700 into 64ff44b
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriy-fix committed May 14, 2019
2 parents 64ff44b + 9fd5700 commit 7d5050d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/vaadin-text-field-mixin.html
Expand Up @@ -553,6 +553,7 @@
}

this.$.clearButton.addEventListener('mousedown', () => this._valueClearing = true);
this.$.clearButton.addEventListener('mouseleave', () => this._valueClearing = false);
this.$.clearButton.addEventListener('click', this._onClearButtonClick.bind(this));
this.addEventListener('keydown', this._onKeyDown.bind(this));

Expand Down
13 changes: 13 additions & 0 deletions test/text-field.html
Expand Up @@ -232,6 +232,19 @@
expect(changeSpy).to.be.calledOnce;
});

it('should not prevent dispatching the change event if clear button wasn\'t clicked', function() {
const changeSpy = sinon.spy();
textField.addEventListener('change', changeSpy);

// Simulate leaving the clear button after mousedown
textField.$.clearButton.dispatchEvent(new CustomEvent('mousedown'));
textField.$.clearButton.dispatchEvent(new CustomEvent('mouseleave'));

// Emulates native change coming from input.
textField.inputElement.dispatchEvent(new Event('change', {bubbles: !condition}));
expect(changeSpy).to.be.calledOnce;
});

it('should update input value when setting value after clicking clear button', function() {
textField.clearButtonVisible = true;
textField.value = 'Foo';
Expand Down
12 changes: 6 additions & 6 deletions wct.conf.js
Expand Up @@ -33,17 +33,17 @@ module.exports = {

registerHooks: function(context) {
const saucelabsPlatformsMobile = [
'iOS Simulator/iphone@11.3',
'iOS Simulator/iphone@9.3'
'iOS Simulator/iphone@12.2',
'iOS Simulator/iphone@10.3'
];

const saucelabsPlatformsMicrosoft = [
'Windows 10/microsoftedge@17',
'Windows 10/microsoftedge@18',
'Windows 10/internet explorer@11'
];

const saucelabsPlatformsDesktop = [
'macOS 10.13/safari@11.1'
'macOS 10.13/safari@latest'
];

const saucelabsPlatforms = [
Expand All @@ -56,10 +56,10 @@ module.exports = {
{
deviceName: 'Android GoogleAPI Emulator',
platformName: 'Android',
platformVersion: '7.1',
platformVersion: '8.1',
browserName: 'chrome'
},
'iOS Simulator/ipad@11.3',
'iOS Simulator/ipad@12.2',
'iOS Simulator/iphone@10.3',
'Windows 10/chrome@latest',
'Windows 10/firefox@latest'
Expand Down

0 comments on commit 7d5050d

Please sign in to comment.