Skip to content

Commit

Permalink
refactor: remove unnecessary value commit on focusout
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan committed Jul 16, 2024
1 parent 9ee8bd7 commit 609e1e3
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions packages/time-picker/src/vaadin-time-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import '@vaadin/input-container/src/vaadin-input-container.js';
import './vaadin-time-picker-combo-box.js';
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
import { isKeyboardActive } from '@vaadin/a11y-base/src/focus-utils.js';
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
Expand Down Expand Up @@ -460,11 +459,6 @@ class TimePicker extends PatternMixin(InputControlMixin(ThemableMixin(ElementMix
super._setFocused(focused);

if (!focused) {
if (!this.opened || isKeyboardActive()) {
// Do not commit value change on blur when closing on outside click.
this.__commitValueChange();
}

// Do not validate when focusout is caused by document
// losing focus, which happens on browser tab switch.
if (document.hasFocus()) {
Expand Down Expand Up @@ -545,6 +539,7 @@ class TimePicker extends PatternMixin(InputControlMixin(ThemableMixin(ElementMix
*/
__commitValueChange() {
const unparsableValue = this.__unparsableValue;
console.warn('commit');

if (this.__committedValue !== this.value) {
this.validate();
Expand Down

0 comments on commit 609e1e3

Please sign in to comment.