summaryrefslogtreecommitdiffstats
path: root/src/directives
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-12-03 13:10:44 +0100
committerJulius Härtl <jus@bitgrid.net>2018-12-03 13:10:44 +0100
commit1782e51169f5d1d390a7916a9a102bc015cb5cdd (patch)
treed49903357df0018f62a0346675e31d561bd00780 /src/directives
parentd8b15e4bb1154aac96fb184993828df5dd4f687a (diff)
Focus input when emoji picker is shown
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'src/directives')
-rw-r--r--src/directives/focusOnCreate.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/directives/focusOnCreate.js b/src/directives/focusOnCreate.js
new file mode 100644
index 00000000..d2a73db0
--- /dev/null
+++ b/src/directives/focusOnCreate.js
@@ -0,0 +1,31 @@
+/*
+ * @copyright Copyright (c) 2018 Julius Härtl <jus@bitgrid.net>
+ *
+ * @author Julius Härtl <jus@bitgrid.net>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+import Vue from 'vue'
+
+export default {
+ bind: function(el) {
+ Vue.nextTick(() => {
+ el.focus()
+ })
+ }
+}