Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draggable content is not selectable #71

Closed
dvago opened this issue Aug 3, 2019 · 2 comments
Closed

Draggable content is not selectable #71

dvago opened this issue Aug 3, 2019 · 2 comments

Comments

@dvago
Copy link

dvago commented Aug 3, 2019

I've been integrating this library within a UI where I need to have draggable and resizable dialog boxes.

The script runs smoothly however I realised that there is no way to make the content of the draggable block selectable by the user.

The draggable instance has the property dragHandle set to the dialog's header and I tweaked the pseudo element within the class .vdr.active with the following style:

&:before {
   z-index: -1;
   outline: none;
}

I've also tried to create a simple version with a placeholder text and it seems that there is nothing I can do, neither overriding the css with user-select: text and pointer-events attribute.

@oshell
Copy link

oshell commented Jan 21, 2020

have the same issue

@KnownRock
Copy link

You can prevent the event from bubbling in the upper node of the input

<vue-drag-resize :isActive="false" :w="200" :h="200" v-on:resizing="resize" v-on:dragging="resize"> 
    <div @mousedown="mousedown" @mouseup="mouseup">
       <h3>Hello World!</h3>
       <p>{{ top }} х {{ left }} </p>
       <p>{{ width }} х {{ height }}</p>
       <input></input>
    </div>
</vue-drag-resize>
new Vue({
    el:container,
    data(){
        return {
            width: 0,
            height: 0,
            top: 0,
            left: 0
        }
    },
    methods: {
        resize(newRect) {
            this.width = newRect.width;
            this.height = newRect.height;
            this.top = newRect.top;
            this.left = newRect.left;
        },
        mousedown(e){
            e.stopPropagation()
        },
        mouseup(e){
            e.stopPropagation()
        }
    }
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants