Skip to content
This repository has been archived by the owner on Apr 8, 2022. It is now read-only.

Input text field in custom colorpicker template does not allow click/input interactions #140

Closed
natatat opened this issue Oct 15, 2015 · 1 comment
Labels
Milestone

Comments

@natatat
Copy link

natatat commented Oct 15, 2015

I'm trying to add an input field to the colorpicker template itself, but I can't interact with the input when I do.

    $('.color').colorpicker({
        template: '<div class="colorpicker dropdown-menu">' +
          '<div class="colorpicker-saturation"><i><b></b></i></div>' +
          '<div class="colorpicker-hue"><i></i></div>' +
          '<div class="colorpicker-color"><div /></div>' +
          '<input class="hex-input" type="text">' +
          '</div>'
    });

link to fiddle here

@itsjavi
Copy link
Owner

itsjavi commented Nov 15, 2015

hi @natatat it seems a problem with the mousedown event, that's applied to the entire colorpicker. As a temporary workaround, try to focus the input when clicked/tapped via events like:

$('.hex-input').on('click touchstart mousedown', function(){$(this).focus()})

cheers

@itsjavi itsjavi added the bug label Nov 16, 2015
itsjavi pushed a commit that referenced this issue Apr 6, 2016
itsjavi pushed a commit that referenced this issue Apr 9, 2016
@itsjavi itsjavi added this to the v3.0.0 milestone Apr 18, 2016
itsjavi pushed a commit that referenced this issue Sep 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants