@@ -286,6 +286,8 @@ class ThemeFontFamilySetting extends StatefulWidget {
286
286
});
287
287
288
288
final String currentFontFamily;
289
+ static Key textFieldKey = const Key ('FontFamilyTextField' );
290
+ static Key popoverKey = const Key ('FontFamilyPopover' );
289
291
290
292
@override
291
293
State <ThemeFontFamilySetting > createState () => _ThemeFontFamilySettingState ();
@@ -298,6 +300,7 @@ class _ThemeFontFamilySettingState extends State<ThemeFontFamilySetting> {
298
300
@override
299
301
Widget build (BuildContext context) {
300
302
return ThemeSettingDropDown (
303
+ popoverKey: ThemeFontFamilySetting .popoverKey,
301
304
label: LocaleKeys .settings_appearance_fontFamily_label.tr (),
302
305
currentValue: parseFontFamilyName (widget.currentFontFamily),
303
306
onClose: () {
@@ -310,6 +313,7 @@ class _ThemeFontFamilySettingState extends State<ThemeFontFamilySetting> {
310
313
padding: const EdgeInsets .only (right: 8 ),
311
314
sliver: SliverToBoxAdapter (
312
315
child: FlowyTextField (
316
+ key: ThemeFontFamilySetting .textFieldKey,
313
317
hintText: LocaleKeys .settings_appearance_fontFamily_search.tr (),
314
318
autoFocus: false ,
315
319
debounceDuration: const Duration (milliseconds: 300 ),
@@ -364,6 +368,8 @@ class _ThemeFontFamilySettingState extends State<ThemeFontFamilySetting> {
364
368
key: UniqueKey (),
365
369
height: 32 ,
366
370
child: FlowyButton (
371
+ key: Key (buttonFontFamily),
372
+ onHover: (_) => FocusScope .of (context).unfocus (),
367
373
text: FlowyText .medium (
368
374
parseFontFamilyName (style.fontFamily! ),
369
375
fontFamily: style.fontFamily! ,
@@ -394,11 +400,13 @@ class ThemeSettingDropDown extends StatefulWidget {
394
400
required this .label,
395
401
required this .currentValue,
396
402
required this .popupBuilder,
403
+ this .popoverKey,
397
404
this .onClose,
398
405
});
399
406
400
407
final String label;
401
408
final String currentValue;
409
+ final Key ? popoverKey;
402
410
final Widget Function (BuildContext ) popupBuilder;
403
411
final void Function ()? onClose;
404
412
@@ -418,6 +426,7 @@ class _ThemeSettingDropDownState extends State<ThemeSettingDropDown> {
418
426
),
419
427
),
420
428
AppFlowyPopover (
429
+ key: widget.popoverKey,
421
430
direction: PopoverDirection .bottomWithRightAligned,
422
431
popupBuilder: widget.popupBuilder,
423
432
constraints: const BoxConstraints (
0 commit comments