Skip to content

Commit

Permalink
fix: no focus border on date cells (#1469)
Browse files Browse the repository at this point in the history
* fix: no focus border on date cells

* fix: remove redundant import

* refactor: use existing functionality from GridCellWidget for focus border

* refactor: use requestBeginFocus override instead of GestureDetector
  • Loading branch information
Eakam1007 authored Dec 21, 2022
1 parent 9a387b2 commit 873a46e
Showing 1 changed file with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,13 @@ class _DateCellState extends GridCellState<GridDateCell> {
constraints: BoxConstraints.loose(const Size(260, 500)),
margin: EdgeInsets.zero,
child: SizedBox.expand(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () => _popover.show(),
child: Align(
alignment: alignment,
child: Padding(
padding: GridSize.cellContentInsets,
child: FlowyText.medium(
state.dateStr,
overflow: TextOverflow.ellipsis,
),
child: Align(
alignment: alignment,
child: Padding(
padding: GridSize.cellContentInsets,
child: FlowyText.medium(
state.dateStr,
overflow: TextOverflow.ellipsis,
),
),
),
Expand Down Expand Up @@ -108,7 +104,10 @@ class _DateCellState extends GridCellState<GridDateCell> {
}

@override
void requestBeginFocus() {}
void requestBeginFocus() {
_popover.show();
widget.onCellEditing.value = true;
}

@override
String? onCopy() => _cellBloc.state.dateStr;
Expand Down

0 comments on commit 873a46e

Please sign in to comment.