athena-ui-js 2.6.0 → 2.6.1

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.
package/README.md CHANGED
@@ -5,7 +5,7 @@ layout (header, menu, content wrapper, footer) from a single `init()` call, load
5
5
  and theme, and ships the building blocks of a multipurpose application: forms, tables, charts,
6
6
  feedback, navigation, a router and more.
7
7
 
8
- Current version: **2.6.0**
8
+ Current version: **2.6.1**
9
9
 
10
10
  [Quick start](#usage) · [API](#api) · [Components](#charts) · [Themes](#themes) · [Tests](#tests) · [Release notes](#releases)
11
11
 
@@ -882,6 +882,10 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
882
882
 
883
883
  ## Releases
884
884
 
885
+ ### 2.6.1
886
+ #### Fixed:
887
+ 1. **A form reported one keystroke in an autocomplete twice**: the combobox announces every change of its value itself (as a `change` event), and the form listened to `input` as well, so `onChange` of the field and of the form ran twice for each typed character. They run once now, and typing in a multiselect (a search, not a change of the value) reports nothing; choosing and removing a chip still report once. The page of an application that asked a server on every change asked it twice (found by the metrics page of Heimdall)
888
+
885
889
  ### 2.6.0
886
890
  (what moving Odin NS Manager onto Athena UI 2.x showed was missing)
887
891
  #### Added:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "athena-ui-js",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "description": "A small, dependency-free UI framework: forms, tables, charts, menus, dialogs, themes and a router, written as ES modules.",
5
5
  "type": "module",
6
6
  "main": "./src/athena-ui.js",
package/src/athena-ui.js CHANGED
@@ -2,7 +2,7 @@
2
2
  //Author: Csaba Tóth https://github.com/csabatibortoth/
3
3
  //LICENCE: MIT
4
4
  //Repository: https://github.com/csabatibortoth/athena-ui
5
- //Version: 2.6.0
5
+ //Version: 2.6.1
6
6
 
7
7
  // The whole API as ES module exports. There are no side effects: importing this file does not touch the page, does not load a script and does not
8
8
  // put anything on globalThis. For pages that need globals use `athena-ui-js/classic`, and to download only what you use import from the entry points
@@ -6,7 +6,7 @@
6
6
  export const BORDERED_CLASS = "default-cointainer-bordered";
7
7
 
8
8
  export const defaults = Object.freeze({
9
- version: "2.6.0",
9
+ version: "2.6.1",
10
10
  container_class: "container",
11
11
  header_class: "header-container",
12
12
  header_menu_class: "header-menu menu",
@@ -133,7 +133,7 @@ export function generateField(options = {}) {
133
133
  let controlNodes;
134
134
  let getValue;
135
135
  let setValue;
136
- const events = ["input", "change"];
136
+ let events = ["input", "change"];
137
137
  const container = grouped ? el("fieldset", { class: "field-group" }, el("legend", {}, caption ?? "")) : wrapper;
138
138
 
139
139
  if (type === "textarea") {
@@ -180,6 +180,9 @@ export function generateField(options = {}) {
180
180
  controlNodes = [combo.element];
181
181
  getValue = combo.getValue;
182
182
  setValue = combo.setValue;
183
+ // The combobox announces every change of its value itself, as a "change" event: typing (a free text), choosing, removing a chip. Listening to "input" as well would
184
+ // report one keystroke twice (and typing in a multiselect is not a change of the value at all).
185
+ events = ["change"];
183
186
  } else if (type === "daterange") {
184
187
  const range = createDateRange({ id, name, value: options.value, min: options.min, max: options.max, disabled: options.disabled });
185
188
  controls = range.inputs;