1
0
mirror of https://gitlab.com/bramw/baserow.git synced 2024-11-25 00:46:46 +00:00
bramw_baserow/web-frontend/modules/database/components/view/grid/fields/GridViewFieldText.vue

35 lines
785 B
Vue

<template>
<div
ref="cell"
class="grid-view__cell active"
:class="{ editing: editing }"
@contextmenu="stopContextIfEditing($event)"
>
<div v-if="!editing" class="grid-field-text">{{ value }}</div>
<input
v-else
ref="input"
v-model="copy"
type="text"
class="grid-field-text__input"
/>
</div>
</template>
<script>
import gridField from '@baserow/modules/database/mixins/gridField'
import gridFieldInput from '@baserow/modules/database/mixins/gridFieldInput'
export default {
mixins: [gridField, gridFieldInput],
methods: {
afterEdit() {
this.$nextTick(() => {
this.$refs.input.focus()
this.$refs.input.selectionStart = this.$refs.input.selectionEnd = 100000
})
},
},
}
</script>