# HG changeset patch # User ymh # Date 1539248704 -7200 # Node ID f98efa1bddd13e5acc503c5560fe3d6d20056ff8 # Parent ea92f4fe783d543dad1adf2931270e68162a92e0 Correct session edition diff -r ea92f4fe783d -r f98efa1bddd1 client/src/components/SessionForm.js --- a/client/src/components/SessionForm.js Mon Oct 08 18:35:47 2018 +0200 +++ b/client/src/components/SessionForm.js Thu Oct 11 11:05:04 2018 +0200 @@ -24,7 +24,7 @@ } onChangeThrottle = _.debounce((changes) => { - this.props.sessionsActions.updateSession(this.props.currentSession, changes); + this.props.sessionsActions.updateSession(this.props.currentSession._id, changes); }, 750) onGroupChange = (e) => { @@ -92,16 +92,19 @@ saveEdit = (e) => { + // e.preventDefault(); - if (e.key === 'Enter') { - this.setState({enterKeyValue: true}) - } + // if (e.key === 'Enter') { + // this.setState({enterKeyValue: true}) + // } - if (e.key !== 'Enter') { - this.setState({enterKeyValue: false}) - } + // if (e.key !== 'Enter') { + // this.setState({enterKeyValue: false}) + // } if (e.key === 'Enter' && this.state.enterKeyValue === true) { + + e.preventDefault(); this.setState({ enterKeyValue: false, titleEditMode: false, diff -r ea92f4fe783d -r f98efa1bddd1 client/src/components/SessionForm.scss --- a/client/src/components/SessionForm.scss Mon Oct 08 18:35:47 2018 +0200 +++ b/client/src/components/SessionForm.scss Thu Oct 11 11:05:04 2018 +0200 @@ -9,10 +9,6 @@ z-index: 5; } - &-page-card { - background: linear-gradient(white, transparent); - } - &-page-title{ font-size: 1.8rem; resize: auto; diff -r ea92f4fe783d -r f98efa1bddd1 client/src/components/SlateEditor/index.js --- a/client/src/components/SlateEditor/index.js Mon Oct 08 18:35:47 2018 +0200 +++ b/client/src/components/SlateEditor/index.js Thu Oct 11 11:05:04 2018 +0200 @@ -399,10 +399,6 @@ const {value} = this.state; - // if (e.key === 'Enter' && value.document.text === '') { - // change.removeChild() - // } - if (e.key === 'Enter' && value.document.text !== '') { this.setState({enterKeyValue: 1}) } @@ -414,6 +410,7 @@ } + //TODO review the double enter case. if (e.key === 'Enter' && !this.props.isChecked && this.state.enterKeyValue === 1 && typeof this.props.onEnterKeyDown === 'function') { e.preventDefault(); this.props.onEnterKeyDown();