Skip to content

Commit

Permalink
fix: Color picker hex field (#2415)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
geronimol and EchoEllet authored Dec 19, 2024
1 parent 505ed70 commit 9eacc2a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/src/toolbar/buttons/color/color_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ class ColorPickerDialogState extends State<ColorPickerDialog> {
@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
Expand Down

0 comments on commit 9eacc2a

Please sign in to comment.