Polls: [1.2.0 RC2] Autofocus and cursor pointer

Created on 15 Feb 2020  路  10Comments  路  Source: nextcloud/polls

I tested the new 1.2.0 RC2. It is very good. But I have twi minimal enhancements.

  1. If I create a public link to share the plus icon is not a pointer cursor:
    image

  2. If I visit the shared link the autofocus is not on the username textarea:
    image

UX bug enhancement

All 10 comments

resolved in 1.3

Em. I think I dreamt about that. Still open.

I changed the link for creating a public share to a button. Fits better to an action like this IMHO.

I tried different approches, but I can't get the focus on this input field. Anyone who has a solution?

I can have a look at this tomorrow

It should work here:
https://github.com/nextcloud/polls/blob/f878de9715b6b8891cade72ede259c7ae75d014b/src/js/components/VoteTable/VoteHeaderPublic.vue#L119-L128
But I get a JS error:

Vue warn]: Error in nextTick: "TypeError: _this.$refs.userName is undefined"

found in

---> <VoteHeaderPublic> at src/js/components/VoteTable/VoteHeaderPublic.vue

Calling $vm0.$refs.userName.focus() in the js console works then (VoteHeaderPublic as $vm0).

I also tried to do this via a directive, but I get the same error.

I guess, the modal component rendering is not ready, when calling from mounted(). Maybe @skjnldsv can explain, if you find no way.

Problem is the v-if together with vuex (if I read this correctly in different issues). I fixed it by adding a watcher to the v-if condition (poll.id) and then calling this.setFocus() instead of in mounted().

watch: {
    userName: function() {
            ...
    },
        'poll.id': function(newValue) {
            this.setFocus()
        }
},

mounted() {
    // removed this.setFocus()
},

@dartcafe Do you already have a branch or something for this issue or should I fix it?

https://github.com/nextcloud/polls/tree/publicLinkCursor adresses the other issue (pointer cursor). I also added a custom button component there.

Problem is the v-if together with vuex

Ah, yes. I had some also, so I used v-show in some places because of that.

@v1r0x I wanted to test your solution and already applied it to the branch. Works perfectly 馃憤 Didn't want to rush things, but I was curious.

Was this page helpful?
0 / 5 - 0 ratings