diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f1c44468..3aaa48bb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- 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). + ## [11.0.0-dev.16] - 2024-12-13 ### Changed diff --git a/lib/src/toolbar/buttons/color/color_dialog.dart b/lib/src/toolbar/buttons/color/color_dialog.dart index acfabc9f2..c67a0e9f0 100644 --- a/lib/src/toolbar/buttons/color/color_dialog.dart +++ b/lib/src/toolbar/buttons/color/color_dialog.dart @@ -39,13 +39,13 @@ class ColorPickerDialogState extends State { @override void initState() { super.initState(); - hexController = - TextEditingController(text: color_picker.colorToHex(selectedColor)); if (widget.isToggledColor) { selectedColor = widget.isBackground ? hexToColor(widget.selectionStyle.attributes['background']?.value) : hexToColor(widget.selectionStyle.attributes['color']?.value); } + hexController = + TextEditingController(text: color_picker.colorToHex(selectedColor)); } @override