Skip to content

Commit 5e39e5b

Browse files
authored
Allow removing font size attribute from text (singerdmx#817)
1 parent 2addd73 commit 5e39e5b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/src/widgets/toolbar.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,13 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
198198
),
199199
],
200200
onSelected: (newSize) {
201-
controller.formatSelection(
202-
Attribute.fromKeyValue('size', getFontSize(newSize)));
201+
if (newSize == '0') {
202+
controller
203+
.formatSelection(Attribute.fromKeyValue('size', null));
204+
} else {
205+
controller.formatSelection(
206+
Attribute.fromKeyValue('size', getFontSize(newSize)));
207+
}
203208
},
204209
rawItemsMap: fontSizes,
205210
),

0 commit comments

Comments
 (0)