From 2b186e2362796718e603ba923e6d498a9478cc4f Mon Sep 17 00:00:00 2001 From: Chen-I Lim Date: Fri, 20 Nov 2020 11:54:40 -0800 Subject: [PATCH] Auto-focus on card title only if its empty --- webapp/src/components/cardDetail.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webapp/src/components/cardDetail.tsx b/webapp/src/components/cardDetail.tsx index 347b7c933..fc294c007 100644 --- a/webapp/src/components/cardDetail.tsx +++ b/webapp/src/components/cardDetail.tsx @@ -44,7 +44,9 @@ class CardDetail extends React.Component { } componentDidMount(): void { - this.titleRef.current?.focus() + if (!this.state.title) { + this.titleRef.current?.focus() + } } constructor(props: Props) {