Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

250
Vistas
How to use Html Drag & Drop API with select element

I am working on a system which uses the HTML Drag & Drop API.

If I add the draggable="true" attribute to the select element, then it does not work as I expect. It is not draggable. When I try to drag it, it just opens the select dropdown. I could make it draggable by adding pointer-events:none to the CSS, but then the select element becomes unavailable.

I need to have the behavior like the standard input element. When I create an input element that has draggable="true" then I should be able to click it to write inside it, and I should also be able to press and hold down to drag it somewhere else.

Here is my code snippet:

<div>Works with input: <input type="text" draggable="true" /></div>
<div>
  Does not work with select:
  <select draggable="true">
    <option>Example Option</option>
  </select>
</div>

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You could wrap the select with a div and apply a small padding and then you would be able to drag the div, and/or you could put an icon within the div and then allow that to be dragged as well.

The emoji hand, ✋ &#9995;, is just for demonstration purposes.

Also if you apply cursor: grab to this div then it will be obvious to the user when the select can be dragged.

<div>Works with input: <input type="text" draggable="true" /></div>
<div>
  <div>
    Does not work with select:
    <div style="display:inline-block; padding:2px; cursor: grab ;" draggable="true">
      <select>
        <option>Example Option 1</option>
        <option>Example Option 2</option>
        <option>Example Option 3</option>
      </select>&#9995;
    </div>
  </div>
</div>

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda