[FEAT] Focus cursor to textarea (#1959)

* Focus cursor to textarea 

Fix need for additional click to textarea before pasting

* [FEAT] autofocus textarea on paste request

closes #1959

* format arba

* bundle

---------

Co-authored-by: dni  <office@dnilabs.com>
This commit is contained in:
arbadacarba
2023-09-25 11:59:04 +02:00
committed by GitHub
parent a8082f798f
commit 193c751670
3 changed files with 12 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
// update cache version every time there is a new deployment // update cache version every time there is a new deployment
// so the service worker reinitializes the cache // so the service worker reinitializes the cache
const CACHE_VERSION = 53 const CACHE_VERSION = 54
const CURRENT_CACHE = `lnbits-${CACHE_VERSION}-` const CURRENT_CACHE = `lnbits-${CACHE_VERSION}-`
const getApiKey = request => { const getApiKey = request => {

View File

@@ -335,6 +335,7 @@ new Vue({
this.parse.data.comment = '' this.parse.data.comment = ''
this.parse.data.paymentChecker = null this.parse.data.paymentChecker = null
this.parse.camera.show = false this.parse.camera.show = false
this.focusInput('textArea')
}, },
updateBalance: function (credit) { updateBalance: function (credit) {
LNbits.api LNbits.api
@@ -799,6 +800,7 @@ new Vue({
}) })
}, },
pasteToTextArea: function () { pasteToTextArea: function () {
this.$refs.textArea.focus() // Set cursor to textarea
navigator.clipboard.readText().then(text => { navigator.clipboard.readText().then(text => {
this.$refs.textArea.value = text this.$refs.textArea.value = text
}) })

File diff suppressed because one or more lines are too long