From 951aba1a4d8d9dfeb016ac33adbcb88bd5adfde7 Mon Sep 17 00:00:00 2001 From: Chen-I Lim Date: Thu, 12 Nov 2020 14:06:19 -0800 Subject: [PATCH] Focus on card title when opening cards --- webapp/src/components/cardDetail.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webapp/src/components/cardDetail.tsx b/webapp/src/components/cardDetail.tsx index 48b3d68d2..347b7c933 100644 --- a/webapp/src/components/cardDetail.tsx +++ b/webapp/src/components/cardDetail.tsx @@ -39,10 +39,14 @@ type State = { class CardDetail extends React.Component { private titleRef = React.createRef() - shouldComponentUpdate() { + shouldComponentUpdate(): boolean { return true } + componentDidMount(): void { + this.titleRef.current?.focus() + } + constructor(props: Props) { super(props) this.state = {