mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: do not rebuild hover on item selection (#3423)
This commit is contained in:
parent
daf9b48c73
commit
b700f95c7f
@ -249,21 +249,23 @@ class SingleInnerViewItem extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _SingleInnerViewItemState extends State<SingleInnerViewItem> {
|
||||
bool _isHovering = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (widget.isFeedback) {
|
||||
return _buildViewItem(false);
|
||||
}
|
||||
|
||||
return FlowyHover(
|
||||
style: HoverStyle(
|
||||
hoverColor: Theme.of(context).colorScheme.secondary,
|
||||
return MouseRegion(
|
||||
onEnter: (_) => setState(() => _isHovering = true),
|
||||
onExit: (_) => setState(() => _isHovering = false),
|
||||
child: FlowyHover(
|
||||
isSelected: () =>
|
||||
widget.showActions ||
|
||||
getIt<MenuSharedState>().latestOpenView?.id == widget.view.id,
|
||||
child: _buildViewItem(_isHovering),
|
||||
),
|
||||
buildWhenOnHover: () => !widget.showActions,
|
||||
builder: (_, onHover) => _buildViewItem(onHover),
|
||||
isSelected: () =>
|
||||
widget.showActions ||
|
||||
getIt<MenuSharedState>().latestOpenView?.id == widget.view.id,
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user