mirror of
https://gitlab.com/bramw/baserow.git
synced 2025-04-10 23:50:12 +00:00
Merge branch '129-pressing-enter-in-the-long-text-field-in-the-edit-model-blurs-the-input' into 'develop'
Resolve "Pressing enter in the long text field in the edit model blurs the input" Closes #129 See merge request bramw/baserow!90
This commit is contained in:
commit
6b0b458cfc
4 changed files with 13 additions and 3 deletions
changelog.md
web-frontend/modules/database
|
@ -2,6 +2,11 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
* Prevent adding a new line to the long text field in the grid view when selecting the
|
||||
cell by pressing the enter key.
|
||||
|
||||
## Released (2020-09-02)
|
||||
|
||||
* Added contribution guidelines.
|
||||
* Fixed bug where it was not possible to change the table name when it contained a link
|
||||
row field.
|
||||
|
|
|
@ -98,6 +98,7 @@ export default {
|
|||
this.$nextTick(() => {
|
||||
const input =
|
||||
event !== null &&
|
||||
event.type === 'click' &&
|
||||
this.field.date_include_time &&
|
||||
event.target === this.$refs.timeDisplay
|
||||
? this.$refs.time
|
||||
|
|
|
@ -24,7 +24,11 @@ import gridFieldInput from '@baserow/modules/database/mixins/gridFieldInput'
|
|||
export default {
|
||||
mixins: [gridField, gridFieldInput],
|
||||
methods: {
|
||||
afterEdit() {
|
||||
afterEdit(event) {
|
||||
// If the enter key is pressed we do not want to add a new line to the textarea.
|
||||
if (event.type === 'keydown' && event.keyCode === 13) {
|
||||
event.preventDefault()
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs.input.focus()
|
||||
this.$refs.input.selectionStart = this.$refs.input.selectionEnd = 100000
|
||||
|
|
|
@ -51,12 +51,12 @@ export default {
|
|||
this.save()
|
||||
} else if (!this.editing) {
|
||||
// If only selected we will start the editing mode.
|
||||
this.edit()
|
||||
this.edit(null, event)
|
||||
}
|
||||
} else if (!this.editing && isCharacterKeyPress(event)) {
|
||||
// If another key was pressed while not editing we want to replace the
|
||||
// exiting value with something new.
|
||||
this.edit('')
|
||||
this.edit('', event)
|
||||
}
|
||||
}
|
||||
document.body.addEventListener('keydown', this.$el.keydownEvent)
|
||||
|
|
Loading…
Add table
Reference in a new issue