Skip to content

Commit

Permalink
refactor: remove useless _filterValue property and related listeners (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
vursen authored Mar 28, 2024
1 parent cfc0c07 commit d6c485b
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions packages/grid/src/vaadin-grid-filter-column-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,7 @@ export const GridFilterColumnMixin = (superClass) =>
}

static get observers() {
return ['_onHeaderRendererOrBindingChanged(_headerRenderer, _headerCell, path, header, _filterValue)'];
}

constructor() {
super();

this.__boundOnFilterValueChanged = this.__onFilterValueChanged.bind(this);
return ['_onHeaderRendererOrBindingChanged(_headerRenderer, _headerCell, path, header)'];
}

/**
Expand All @@ -54,16 +48,12 @@ export const GridFilterColumnMixin = (superClass) =>
textField.setAttribute('theme', 'small');
textField.setAttribute('style', 'max-width: 100%;');
textField.setAttribute('focus-target', '');
textField.addEventListener('value-changed', this.__boundOnFilterValueChanged);
filter.appendChild(textField);
root.appendChild(filter);
}

filter.path = this.path;
filter.value = this._filterValue;

textField.__rendererValue = this._filterValue;
textField.value = this._filterValue;
textField.label = this.__getHeader(this.header, this.path);
}

Expand All @@ -78,21 +68,6 @@ export const GridFilterColumnMixin = (superClass) =>
return this._defaultHeaderRenderer;
}

/**
* Updates the internal filter value once the filter text field is changed.
* The listener handles only user-fired events.
*
* @private
*/
__onFilterValueChanged(e) {
// Skip if the value is changed by the renderer.
if (e.detail.value === e.target.__rendererValue) {
return;
}

this._filterValue = e.detail.value;
}

/** @private */
__getHeader(header, path) {
if (header) {
Expand Down

0 comments on commit d6c485b

Please sign in to comment.