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
No related branches found
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 # 0.1.46
_18th Decemeber 2020_ _18th Decemeber 2020_
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
@focus="editTrue(true)" @focus="editTrue(true)"
@blur="editTrue(false)" @blur="editTrue(false)"
autofocus autofocus
v-focus
v-model="nodes.node_text" v-model="nodes.node_text"
@input="editNode" @input="editNode"
:id="nodes.node_id" :id="nodes.node_id"
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
v-model="nodes.node_text" v-model="nodes.node_text"
@input="editNode" @input="editNode"
:id="nodes.node_id" :id="nodes.node_id"
v-focus
ref="textentry"
placeholder="Type your thoughts and ideas here! (auto saved every keystroke)" placeholder="Type your thoughts and ideas here! (auto saved every keystroke)"
></textarea> ></textarea>
<p class="info">*markdown supported &amp; autosaves</p> <p class="info">*markdown supported &amp; autosaves</p>
...@@ -125,6 +127,7 @@ export default { ...@@ -125,6 +127,7 @@ export default {
const unwatch = this.$watch('nodes_filtered', (value) => { const unwatch = this.$watch('nodes_filtered', (value) => {
this.$options.myArray = this.nodes_filtered this.$options.myArray = this.nodes_filtered
this.$forceUpdate() this.$forceUpdate()
// this.focusInput()
// ignore falsy values // ignore falsy values
if (!value) return if (!value) return
...@@ -153,6 +156,13 @@ export default { ...@@ -153,6 +156,13 @@ export default {
}, },
methods: { methods: {
// focusInput() {
// console.log('focus')
// this.nextTick(() => {
// this.$refs.textentry.$el.focus()
// })
// },
chooseColor(color, nodeid) { chooseColor(color, nodeid) {
this.$store.dispatch('colorNode', { nodeid, color }) this.$store.dispatch('colorNode', { nodeid, color })
this.$options.myArray = this.nodes_filtered this.$options.myArray = this.nodes_filtered
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
@blur="editTrue(false)" @blur="editTrue(false)"
autofocus autofocus
v-model="nodes.node_text" v-model="nodes.node_text"
v-focus
@input="editNode" @input="editNode"
:id="nodes.node_id" :id="nodes.node_id"
placeholder="Type your thoughts and ideas here! (auto saved every keystroke)" placeholder="Type your thoughts and ideas here! (auto saved every keystroke)"
...@@ -110,6 +111,7 @@ ...@@ -110,6 +111,7 @@
@focus="editTrue(true)" @focus="editTrue(true)"
@blur="editTrue(false)" @blur="editTrue(false)"
autofocus autofocus
v-focus
v-model="nodes.node_text" v-model="nodes.node_text"
@input="editNode" @input="editNode"
:id="nodes.node_id" :id="nodes.node_id"
......
...@@ -17,6 +17,15 @@ Vue.component('Icon', Icon) ...@@ -17,6 +17,15 @@ Vue.component('Icon', Icon)
Vue.config.productionTip = false 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({ new Vue({
router, router,
store, store,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment