Skip to content

Commit

Permalink
calendar/EventModal: allow using ctrl+enter to submit modal if the de…
Browse files Browse the repository at this point in the history
…scription textarea is focused
  • Loading branch information
thatoddmailbox committed Nov 23, 2023
1 parent d5cfeab commit 3257775
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/calendar/EventModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ export default class EventModal extends Component {
}
}

textboxKeyup(e) {
if (e.keyCode == 13 && e.ctrlKey) {
this.save();
}
}

pickerChange(type, date) {
var newState = {};
var mergedState = {};
Expand Down Expand Up @@ -350,7 +356,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} onChange={linkState(this, "description")} style={state.descriptionMinHeight ? `min-height: ${state.descriptionMinHeight}px;` : ""} />
<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;` : ""} />
</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 3257775

Please sign in to comment.