Skip to content
Snippets Groups Projects
Commit d47007b4 authored by Adam Procter's avatar Adam Procter
Browse files

focus input now works as expected

parent 995dee88
Branches qol
No related tags found
No related merge requests found
# 0.1.47
_23rd December 2020_
### Changed
- Hiding shortcut tips now will stay hidden per session. (n.b this hides them on all views)
- Focusses input when creating new node enabling fasting entry.
- in Collect view press n, instantly type in ideas, press tab, press n for next idea (SO FAST!)
# 0.1.46
_18th Decemeber 2020_
......
......@@ -22,6 +22,7 @@
@focus="editTrue(true)"
@blur="editTrue(false)"
autofocus
v-focus
v-model="nodes.node_text"
@input="editNode"
:id="nodes.node_id"
......
......@@ -15,6 +15,8 @@
v-model="nodes.node_text"
@input="editNode"
:id="nodes.node_id"
v-focus
ref="textentry"
placeholder="Type your thoughts and ideas here! (auto saved every keystroke)"
></textarea>
<p class="info">*markdown supported &amp; autosaves</p>
......@@ -125,6 +127,7 @@ export default {
const unwatch = this.$watch('nodes_filtered', (value) => {
this.$options.myArray = this.nodes_filtered
this.$forceUpdate()
// this.focusInput()
// ignore falsy values
if (!value) return
......@@ -153,6 +156,13 @@ export default {
},
methods: {
// focusInput() {
// console.log('focus')
// this.nextTick(() => {
// this.$refs.textentry.$el.focus()
// })
// },
chooseColor(color, nodeid) {
this.$store.dispatch('colorNode', { nodeid, color })
this.$options.myArray = this.nodes_filtered
......
......@@ -34,6 +34,7 @@
@blur="editTrue(false)"
autofocus
v-model="nodes.node_text"
v-focus
@input="editNode"
:id="nodes.node_id"
placeholder="Type your thoughts and ideas here! (auto saved every keystroke)"
......@@ -110,6 +111,7 @@
@focus="editTrue(true)"
@blur="editTrue(false)"
autofocus
v-focus
v-model="nodes.node_text"
@input="editNode"
:id="nodes.node_id"
......
......@@ -17,6 +17,15 @@ Vue.component('Icon', Icon)
Vue.config.productionTip = false
// Register a global custom directive called `v-focus`
Vue.directive('focus', {
// When the bound element is inserted into the DOM...
inserted: function (el) {
// Focus the element
el.focus()
},
})
new Vue({
router,
store,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment