@sveltia/ui 0.10.0 → 0.10.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.
@@ -96,7 +96,17 @@ class Group {
96
96
  controlTarget.setAttribute('aria-hidden', String(!isSelected));
97
97
 
98
98
  if (isSelected) {
99
- controlTarget.scrollIntoView({ block: 'nearest', inline: 'nearest', behavior: 'auto' });
99
+ window.setTimeout(() => {
100
+ try {
101
+ controlTarget.scrollIntoView({
102
+ block: 'nearest',
103
+ inline: 'nearest',
104
+ behavior: 'auto',
105
+ });
106
+ } catch {
107
+ controlTarget.scrollIntoView(true);
108
+ }
109
+ }, 300);
100
110
  }
101
111
  }
102
112
  });
@@ -245,13 +255,30 @@ class Group {
245
255
  controlTarget.setAttribute('aria-hidden', String(!isTarget));
246
256
 
247
257
  if (isTarget) {
248
- controlTarget.scrollIntoView({ block: 'nearest', inline: 'nearest', behavior: 'auto' });
258
+ window.setTimeout(() => {
259
+ try {
260
+ controlTarget.scrollIntoView({
261
+ block: 'nearest',
262
+ inline: 'nearest',
263
+ behavior: 'auto',
264
+ });
265
+ } catch {
266
+ controlTarget.scrollIntoView(true);
267
+ }
268
+ }, 300);
249
269
  }
250
270
  }
251
271
 
252
272
  if (isTarget) {
253
273
  this.parent.setAttribute('aria-activedescendant', element.id);
254
- element.scrollIntoView({ block: 'nearest', inline: 'nearest', behavior: 'auto' });
274
+
275
+ window.setTimeout(() => {
276
+ try {
277
+ element.scrollIntoView({ block: 'nearest', inline: 'nearest', behavior: 'auto' });
278
+ } catch {
279
+ element.scrollIntoView(true);
280
+ }
281
+ }, 300);
255
282
  }
256
283
  });
257
284
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltia/ui",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "publishConfig": {