@dile/crud 2.10.7 → 2.10.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -45,17 +45,13 @@ export class DileCrudSortForm extends DileI18nMixin(LitElement) {
45
45
  constructor() {
46
46
  super();
47
47
  this.sortOptions = [];
48
- this._suppressChangeEcho = false;
49
48
  }
50
49
 
51
50
  // Reflects a sort that was already applied elsewhere (e.g. a DataGrid column header
52
- // click) without re-dispatching sort-changed. Setting `sortField` below causes the
53
- // inner <dile-radio-group> to echo a "changed" event on its own (it can't tell a
54
- // programmatic update from a user click), which radioGroupChanged() would otherwise
55
- // treat as a real selection and re-derive sortDirection from the option's *static*
56
- // configured default — silently overriding whichever direction was actually requested.
51
+ // click) without re-dispatching sort-changed. The inner <dile-radio-group> will echo a
52
+ // "changed" event when its value catches up with `sortField`; radioGroupChanged()
53
+ // ignores it because the value already matches the current `sortField`.
57
54
  syncSort(sortField, sortDirection) {
58
- this._suppressChangeEcho = true;
59
55
  this.sortField = sortField;
60
56
  this.sortDirection = sortDirection;
61
57
  }
@@ -97,8 +93,11 @@ export class DileCrudSortForm extends DileI18nMixin(LitElement) {
97
93
  }
98
94
 
99
95
  radioGroupChanged(e) {
100
- if (this._suppressChangeEcho) {
101
- this._suppressChangeEcho = false;
96
+ // <dile-radio-group> can't tell a user click from a programmatic value update, so it
97
+ // also fires when its value is synced from `sortField` (via syncSort() or a click on an
98
+ // order-switch label). Those echoes always carry the current `sortField`; a real radio
99
+ // click always carries a different one, so this is the only check needed.
100
+ if (e.detail.value === this.sortField) {
102
101
  return;
103
102
  }
104
103
  this.sortField = e.detail.value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dile/crud",
3
- "version": "2.10.7",
3
+ "version": "2.10.8",
4
4
  "description": "Components to create a generic crud system based on Web Components and Lit",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -32,5 +32,5 @@
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
35
- "gitHead": "c6ea1884ed9e678ada87280795043f925102d0e4"
35
+ "gitHead": "2e0fb95e230bf2a1d3ff76cf13a9fc960b279d82"
36
36
  }