Fix View title editing with board change
This commit is contained in:
parent
c333c25bd5
commit
0b34ed8015
3 changed files with 8 additions and 12 deletions
|
@ -128,7 +128,10 @@ class BoardComponent extends React.Component<Props, State> {
|
|||
</RootPortal>}
|
||||
|
||||
<div className='octo-frame'>
|
||||
<ViewTitle board={board}/>
|
||||
<ViewTitle
|
||||
key={board.id + board.title}
|
||||
board={board}
|
||||
/>
|
||||
|
||||
<div className='octo-board'>
|
||||
<ViewHeader
|
||||
|
|
|
@ -71,7 +71,10 @@ class TableComponent extends React.Component<Props, State> {
|
|||
/>
|
||||
</RootPortal>}
|
||||
<div className='octo-frame'>
|
||||
<ViewTitle board={board}/>
|
||||
<ViewTitle
|
||||
key={board.id + board.title}
|
||||
board={board}
|
||||
/>
|
||||
|
||||
<div className='octo-table'>
|
||||
<ViewHeader
|
||||
|
|
|
@ -28,16 +28,6 @@ class ViewTitle extends React.Component<Props, State> {
|
|||
return true
|
||||
}
|
||||
|
||||
static getDerivedStateFromProps(nextProps: Props, prevState: State) {
|
||||
if (prevState.title !== nextProps.board.title) {
|
||||
return {
|
||||
title: nextProps.board.title,
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
constructor(props: Props) {
|
||||
super(props)
|
||||
this.state = {title: props.board.title}
|
||||
|
|
Loading…
Reference in a new issue