Skip to content

Commit 9eacc2a

Browse files
geronimolEchoEllet
andauthored
fix: Color picker hex field (#2415)
* fix: color picker dialog hex field value not setting correctly when selecting a text that has color in the editor and pressing the color button in the toolbar. For more details: #2415 (comment) * docs: add a CHANGELOG entry for the bug fix --------- Co-authored-by: Ellet <[email protected]>
1 parent 505ed70 commit 9eacc2a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
1111
## [Unreleased]
1212

13+
### Fixed
14+
15+
- The color picker dialog's hex field does not use the correct value of the selected text in the editor [#2415](https://github.com/singerdmx/flutter-quill/pull/2415).
16+
1317
## [11.0.0-dev.16] - 2024-12-13
1418

1519
### Changed

lib/src/toolbar/buttons/color/color_dialog.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ class ColorPickerDialogState extends State<ColorPickerDialog> {
3939
@override
4040
void initState() {
4141
super.initState();
42-
hexController =
43-
TextEditingController(text: color_picker.colorToHex(selectedColor));
4442
if (widget.isToggledColor) {
4543
selectedColor = widget.isBackground
4644
? hexToColor(widget.selectionStyle.attributes['background']?.value)
4745
: hexToColor(widget.selectionStyle.attributes['color']?.value);
4846
}
47+
hexController =
48+
TextEditingController(text: color_picker.colorToHex(selectedColor));
4949
}
5050

5151
@override

0 commit comments

Comments
 (0)