File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11Date format: DD/MM/YYYY
22
3+ ## [ unreleased] - Input Update
4+
5+ - ` TextBox ` updates: ([ #179 ] ( https://github.com/bdlukaa/fluent_ui/pull/179 ) )
6+ - Correctly apply the ` style ` property
7+ - Correctly apply ` decoration ` to the background
8+ - Added ` foregroundDecoration ` and ` highlightColor ` property. They can not be specified at the same time
9+ - ** BREAKING** replaced ` maxLengthEnforeced ` with ` maxLengthEnforcement `
10+ - Expose more propertied to ` TextFormBox `
11+ - ` AutoSuggestBox ` updates:
12+ - Improved fidelity of the suggestions overlay
13+ - When a suggestion is picked, the overlay is automatically closed and the text box is unfocused
14+ - Clear button now only shows when the text box is focused
15+
316## [ 3.9.0] - Fidelity - [ 10/02/2022]
417
518- ** BREAKING** Renamed ` standartCurve ` to ` standardCurve `
Original file line number Diff line number Diff line change @@ -35,6 +35,20 @@ class _FormsState extends State<Forms> {
3535
3636 DateTime date = DateTime .now ();
3737
38+ @override
39+ void initState () {
40+ super .initState ();
41+ _clearController.addListener (() {
42+ if (_clearController.text.length == 1 && mounted) setState (() {});
43+ });
44+ }
45+
46+ @override
47+ void dispose () {
48+ _clearController.dispose ();
49+ super .dispose ();
50+ }
51+
3852 @override
3953 Widget build (BuildContext context) {
4054 return ScaffoldPage .scrollable (
@@ -94,12 +108,14 @@ class _FormsState extends State<Forms> {
94108 controller: _clearController,
95109 suffixMode: OverlayVisibilityMode .always,
96110 minHeight: 100 ,
97- suffix: IconButton (
98- icon: const Icon (FluentIcons .chrome_close),
99- onPressed: () {
100- _clearController.clear ();
101- },
102- ),
111+ suffix: _clearController.text.isEmpty
112+ ? null
113+ : IconButton (
114+ icon: const Icon (FluentIcons .chrome_close),
115+ onPressed: () {
116+ _clearController.clear ();
117+ },
118+ ),
103119 placeholder: 'Text box with clear button' ,
104120 ),
105121 const SizedBox (height: 20 ),
Original file line number Diff line number Diff line change @@ -217,7 +217,9 @@ class _AutoSuggestBoxState<T> extends State<AutoSuggestBox> {
217217 _entry != null ? Clip .none : Clip .antiAliasWithSaveLayer,
218218 suffix: Row (children: [
219219 if (widget.trailingIcon != null ) widget.trailingIcon! ,
220- if (widget.clearButtonEnabled && controller.text.isNotEmpty)
220+ if (widget.clearButtonEnabled &&
221+ controller.text.isNotEmpty &&
222+ focusNode.hasFocus)
221223 Padding (
222224 padding: const EdgeInsets .only (left: 2.0 ),
223225 child: IconButton (
You can’t perform that action at this time.
0 commit comments