@@ -286,6 +286,8 @@ class ThemeFontFamilySetting extends StatefulWidget {
286286 });
287287
288288 final String currentFontFamily;
289+ static Key textFieldKey = const Key ('FontFamilyTextField' );
290+ static Key popoverKey = const Key ('FontFamilyPopover' );
289291
290292 @override
291293 State <ThemeFontFamilySetting > createState () => _ThemeFontFamilySettingState ();
@@ -298,6 +300,7 @@ class _ThemeFontFamilySettingState extends State<ThemeFontFamilySetting> {
298300 @override
299301 Widget build (BuildContext context) {
300302 return ThemeSettingDropDown (
303+ popoverKey: ThemeFontFamilySetting .popoverKey,
301304 label: LocaleKeys .settings_appearance_fontFamily_label.tr (),
302305 currentValue: parseFontFamilyName (widget.currentFontFamily),
303306 onClose: () {
@@ -310,6 +313,7 @@ class _ThemeFontFamilySettingState extends State<ThemeFontFamilySetting> {
310313 padding: const EdgeInsets .only (right: 8 ),
311314 sliver: SliverToBoxAdapter (
312315 child: FlowyTextField (
316+ key: ThemeFontFamilySetting .textFieldKey,
313317 hintText: LocaleKeys .settings_appearance_fontFamily_search.tr (),
314318 autoFocus: false ,
315319 debounceDuration: const Duration (milliseconds: 300 ),
@@ -364,6 +368,8 @@ class _ThemeFontFamilySettingState extends State<ThemeFontFamilySetting> {
364368 key: UniqueKey (),
365369 height: 32 ,
366370 child: FlowyButton (
371+ key: Key (buttonFontFamily),
372+ onHover: (_) => FocusScope .of (context).unfocus (),
367373 text: FlowyText .medium (
368374 parseFontFamilyName (style.fontFamily! ),
369375 fontFamily: style.fontFamily! ,
@@ -394,11 +400,13 @@ class ThemeSettingDropDown extends StatefulWidget {
394400 required this .label,
395401 required this .currentValue,
396402 required this .popupBuilder,
403+ this .popoverKey,
397404 this .onClose,
398405 });
399406
400407 final String label;
401408 final String currentValue;
409+ final Key ? popoverKey;
402410 final Widget Function (BuildContext ) popupBuilder;
403411 final void Function ()? onClose;
404412
@@ -418,6 +426,7 @@ class _ThemeSettingDropDownState extends State<ThemeSettingDropDown> {
418426 ),
419427 ),
420428 AppFlowyPopover (
429+ key: widget.popoverKey,
421430 direction: PopoverDirection .bottomWithRightAligned,
422431 popupBuilder: widget.popupBuilder,
423432 constraints: const BoxConstraints (
0 commit comments