@rogieking/figui3 8.9.29 → 8.9.31

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
@@ -1093,6 +1093,8 @@ When app code rebuilds a chooser by setting `fig-chooser.innerHTML`, the chooser
1093
1093
  | `drag` | boolean | `false` | Enable drag-to-scroll |
1094
1094
  | `overflow` | string | — | Overflow behavior |
1095
1095
  | `loop` | boolean | `false` | Loop keyboard navigation |
1096
+ | `auto-scroll` | boolean | `true` | Automatically center the selection after selection, layout, resize, or media changes. Set to `"false"` to disable. |
1097
+ | `scroll-behavior` | string | `"smooth"` | Selection and overflow-button scrolling behavior: `"smooth"` or `"auto"`. The CSS `scroll-behavior` property can also override it. |
1096
1098
 
1097
1099
  **fig-choice attributes:**
1098
1100
 
@@ -1104,6 +1106,10 @@ When app code rebuilds a chooser by setting `fig-chooser.innerHTML`, the chooser
1104
1106
 
1105
1107
  **Events (on fig-chooser):** `input`, `change` — detail is the selected value string.
1106
1108
 
1109
+ Selection follows the native `<select>` pattern: set `chooser.value` with a choice value, or set `chooser.selectedChoice` with a choice element. Neither programmatic selection nor scrolling emits events.
1110
+
1111
+ When `auto-scroll="false"`, reveal the current selection explicitly with `chooser.scrollSelectionIntoView(options?)`. It accepts native-style `ScrollIntoViewOptions` (`behavior`, `block`, and `inline`) and centers by default.
1112
+
1107
1113
  ```html
1108
1114
  <fig-chooser value="opt1">
1109
1115
  <fig-choice value="opt1">Option 1</fig-choice>
package/components.css CHANGED
@@ -5017,9 +5017,18 @@ fig-chooser {
5017
5017
  overflow: hidden auto;
5018
5018
  padding: 0;
5019
5019
  margin: 0 var(--fig-chooser-inline-margin);
5020
+ scroll-behavior: smooth;
5020
5021
  scrollbar-width: none;
5021
5022
  width: calc(100% - var(--fig-chooser-inline-margin) * 2);
5022
5023
 
5024
+ &[scroll-behavior="auto"] {
5025
+ scroll-behavior: auto;
5026
+ }
5027
+
5028
+ &[scroll-behavior="smooth"] {
5029
+ scroll-behavior: smooth;
5030
+ }
5031
+
5023
5032
  fig-field > &{
5024
5033
  --fig-chooser-inline-margin:0;
5025
5034
  }
@@ -5184,6 +5193,12 @@ fig-chooser {
5184
5193
  }
5185
5194
  }
5186
5195
 
5196
+ @media (prefers-reduced-motion: reduce) {
5197
+ fig-chooser:not([scroll-behavior="smooth"]) {
5198
+ scroll-behavior: auto;
5199
+ }
5200
+ }
5201
+
5187
5202
  fig-card {
5188
5203
  --fig-card-label-line-clamp: 1;
5189
5204
  --fig-card-media-radius: var(--radius-medium);