Skip to content

Commit

Permalink
calendar/EventModal: also allow using shift+enter in description text…
Browse files Browse the repository at this point in the history
…box to submit, for consistency with rest of app
  • Loading branch information
thatoddmailbox committed Nov 23, 2023
1 parent 3257775 commit 1aec2ab
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/calendar/EventModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,11 @@ export default class EventModal extends Component {
}
}

textboxKeyup(e) {
if (e.keyCode == 13 && e.ctrlKey) {
descriptionKeyup(e) {
if (e.keyCode == 13 && (e.shiftKey || e.ctrlKey)) {
this.save();
e.preventDefault();
return false;
}
}

Expand Down Expand Up @@ -356,7 +358,7 @@ export default class EventModal extends Component {

<input type="text" class="form-control eventModalLocation" placeholder="Location" value={state.location} onKeyup={this.keyup.bind(this)} onChange={linkState(this, "location")} />

<textarea class="form-control eventModalDescription" placeholder="Description" value={state.description} onKeyup={this.textboxKeyup.bind(this)} onInput={linkState(this, "description")} style={state.descriptionMinHeight ? `min-height: ${state.descriptionMinHeight}px;` : ""} />
<textarea class="form-control eventModalDescription" placeholder="Description" value={state.description} onKeyup={this.descriptionKeyup.bind(this)} onInput={linkState(this, "description")} style={state.descriptionMinHeight ? `min-height: ${state.descriptionMinHeight}px;` : ""} />
</div>
<div class="modal-footer">
{!state.isNew && <button type="button" class="btn btn-danger" onClick={this.delete.bind(this)}>Delete</button>}
Expand Down

0 comments on commit 1aec2ab

Please sign in to comment.