Repository navigation
Description
Steps to reproduce
flutter create --platforms web --empty slider_repro && cd slider_repro- Replace
lib/main.dartwith the code sample below. It has two sliders: A is enabled from the first frame, B starts disabled (onChanged: null) and is enabled by a button. flutter build web --release, servebuild/web(for examplepython3 -m http.server 8765in that folder) and open it in Chrome.- Press "Enable B" (the app calls
ensureSemantics(), so the semantics tree is already on). - In DevTools, read the hidden range inputs:
[...document.querySelectorAll('flt-semantics-host input[type="range"]')]
.map((e) => [e.getAttribute('aria-valuetext'), e.value, e.min, e.max])Expected results
Slider B's input carries aria-valuetext="B within 5 km" (what semanticFormatterCallback returns) as soon as it is enabled, like slider A does from the first frame.
Actual results
Measured with Playwright on the release build:
aria-valuetext |
value |
min |
max |
|
|---|---|---|---|---|
| A, first frame | A within 5 km |
1 |
0 |
2 |
| B, after enabling | missing | 50 |
empty | empty |
B's input exists only after it is enabled, and it never gets its attributes: no aria-valuetext, and the browser's default range value of 50 out of 0 to 100, which is all assistive technology has to announce. The attributes appear only after B's value changes once.
In our app the distance slider of a filter sheet starts disabled behind an "Anywhere" switch, so a screen-reader user who turns that switch off hears "50" instead of the distance.
Likely cause
From reading lib/web_ui/lib/src/engine/semantics/incrementable.dart (unchanged in this respect on master at f1a0549, 2026-10-02):
- Enabling the slider gives its existing semantics node the increase and decrease actions, so a new
SemanticIncrementableis created for a node whosevalue,increasedValueanddecreasedValuewere set in an earlier update. _pendingResyncstarts asfalse, and none of those fields is dirty in that update, so_updateInputValues()returns early and never writesvalue,min,maxoraria-valuetextto the new<input>.
#187217 (the fix for #186472, in 3.47.0) made update() call _updateInputValues() in every gesture mode, but this dirty check still skips a role created for an already-populated node. A possible fix, untested: start _pendingResync as true, so a role's first update always syncs the input.
Code sample
Code sample
import 'package:flutter/material.dart';
import 'package:flutter/semantics.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
SemanticsBinding.instance.ensureSemantics();
runApp(const MaterialApp(home: Demo()));
}
class Demo extends StatefulWidget {
const Demo({super.key});
@override
State<Demo> createState() => _DemoState();
}
class _DemoState extends State<Demo> {
double a = 5;
double b = 5;
bool bEnabled = false;
@override
Widget build(BuildContext context) => Scaffold(
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// Enabled from the first frame.
Slider(
min: 1,
max: 20,
value: a,
semanticFormatterCallback: (v) => 'A within ${v.round()} km',
onChanged: (v) => setState(() => a = v),
),
// Starts disabled, enabled by the button below.
Slider(
min: 1,
max: 20,
value: b,
semanticFormatterCallback: (v) => 'B within ${v.round()} km',
onChanged: bEnabled ? (v) => setState(() => b = v) : null,
),
ElevatedButton(
onPressed: () => setState(() => bEnabled = true),
child: const Text('Enable B'),
),
],
),
);
}Flutter Doctor output
Doctor output
$ flutter doctor
[✓] Flutter (Channel stable, 3.47.2, on macOS 27.0.1 26A434 darwin-arm64, locale en-GB)
[✓] Chrome - develop for the web
$ flutter --version
Flutter 3.47.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision d3b14c8769 (8 weeks ago) • 2026-08-26 16:07:51 -0700
Engine • hash 1cf1c4773fb941c4c74a7f8bb144a8837596c0f4 (revision a804b26164) (1 months ago) • 2026-08-26 18:46:13.000Z
Tools • Dart 3.13.2 • DevTools 2.60.0Browser: Google Chrome 155.0.8059.85.
Activity
suryaKommana2662 commentedon Oct 26, 2026
@cashmula I was able to reproduce the issue on the web release build. After enabling slider B, its input is missing aria-valuetext, min, and max attributes, while slider A has the expected attributes. The missing attributes appear after changing slider B's value. Routing this to the accessibility team for further investigation.
Flutter Doctor Output
flutter-zl commentedon Oct 28, 2026
flutter-triage-bot commentedon Oct 28, 2026
The
triaged-weblabel is irrelevant if there is noteam-weblabel orfyi-weblabel.flutter-triage-bot commentedon Oct 28, 2026
Issue is assigned to multiple teams (web, accessibility). Please ensure the issue has only one
team-*label at a time. Usefyi-*labels to have another team look at the issue without reassigning it.[web][a11y] Initialize slider semantics values when enabling (flutter…