Skip to content

Commit 1c00bde

Browse files
committed
Update changelog
1 parent 83a803a commit 1c00bde

3 files changed

Lines changed: 38 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
Date 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`

example/lib/screens/forms.dart

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff 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),

lib/src/controls/form/auto_suggest_box.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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(

0 commit comments

Comments
 (0)