disable editor history/persistence when in grid to avoid pesky bug
This commit is contained in:
parent
f593bff3c3
commit
c8243357ea
3 changed files with 22 additions and 1 deletions
|
@ -1690,6 +1690,7 @@ module.exports = React.createClass({
|
||||||
<MessageComposer
|
<MessageComposer
|
||||||
roomViewStore={this.props.roomViewStore}
|
roomViewStore={this.props.roomViewStore}
|
||||||
room={this.state.room}
|
room={this.state.room}
|
||||||
|
isGrid={this.props.isGrid}
|
||||||
onResize={this.onChildResize}
|
onResize={this.onChildResize}
|
||||||
uploadFile={this.uploadFile}
|
uploadFile={this.uploadFile}
|
||||||
callState={this.state.callState}
|
callState={this.state.callState}
|
||||||
|
|
|
@ -359,6 +359,7 @@ export default class MessageComposer extends React.Component {
|
||||||
roomViewStore={this.props.roomViewStore}
|
roomViewStore={this.props.roomViewStore}
|
||||||
ref={(c) => this.messageComposerInput = c}
|
ref={(c) => this.messageComposerInput = c}
|
||||||
key="controls_input"
|
key="controls_input"
|
||||||
|
isGrid={this.props.isGrid}
|
||||||
onResize={this.props.onResize}
|
onResize={this.props.onResize}
|
||||||
room={this.props.room}
|
room={this.props.room}
|
||||||
placeholder={placeholderText}
|
placeholder={placeholderText}
|
||||||
|
|
|
@ -132,6 +132,18 @@ function rangeEquals(a: Range, b: Range): boolean {
|
||||||
&& a.isBackward === b.isBackward);
|
&& a.isBackward === b.isBackward);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class NoopHistoryManager {
|
||||||
|
getItem() {}
|
||||||
|
save() {}
|
||||||
|
|
||||||
|
get currentIndex() { return 0; }
|
||||||
|
set currentIndex(_) {}
|
||||||
|
|
||||||
|
get history() { return []; }
|
||||||
|
set history(_) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The textInput part of the MessageComposer
|
* The textInput part of the MessageComposer
|
||||||
*/
|
*/
|
||||||
|
@ -343,7 +355,14 @@ export default class MessageComposerInput extends React.Component {
|
||||||
|
|
||||||
componentWillMount() {
|
componentWillMount() {
|
||||||
this.dispatcherRef = this.props.roomViewStore.getDispatcher().register(this.onAction);
|
this.dispatcherRef = this.props.roomViewStore.getDispatcher().register(this.onAction);
|
||||||
this.historyManager = new ComposerHistoryManager(this.props.room.roomId, 'mx_slate_composer_history_');
|
if (this.props.isGrid) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
this.historyManager = new NoopHistoryManager();
|
||||||
|
} else {
|
||||||
|
this.historyManager = new ComposerHistoryManager(this.props.room.roomId, 'mx_slate_composer_history_');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue