Skip to content

Commit 2a7502e

Browse files
committed
Disable left/right shortcut key in input and textarea
Closes doccano#488
1 parent 8818ab1 commit 2a7502e

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

frontend/components/containers/annotation/Paginator.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@
6060
</template>
6161

6262
<script>
63-
import Vue from 'vue'
6463
import { mapState, mapActions, mapMutations, mapGetters } from 'vuex'
65-
Vue.use(require('vue-shortkey'))
6664
6765
export default {
6866
data() {

frontend/components/molecules/EntityItem.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@
3535
</template>
3636

3737
<script>
38-
import Vue from 'vue'
3938
import { idealColor } from '~/plugins/utils.js'
40-
Vue.use(require('vue-shortkey'))
4139
4240
export default {
4341
props: {

frontend/components/organisms/annotation/EntityItemBox.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@
4343
</template>
4444

4545
<script>
46-
import Vue from 'vue'
4746
import EntityItem from '~/components/molecules/EntityItem'
48-
Vue.use(require('vue-shortkey'))
4947
5048
export default {
5149
components: {

frontend/nuxt.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ export default {
4848
*/
4949
plugins: [
5050
'~/plugins/filters.js',
51-
'~/plugins/vue-youtube.js'
51+
'~/plugins/vue-youtube.js',
52+
'~/plugins/vue-shortkey.js'
5253
],
5354
/*
5455
** Nuxt.js modules

frontend/plugins/vue-shortkey.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Vue from 'vue'
2+
const ShortKey = require('vue-shortkey')
3+
4+
// add any custom shortkey config settings here
5+
Vue.use(ShortKey, { prevent: ['input', 'textarea'] })
6+
7+
export default ShortKey

0 commit comments

Comments
 (0)