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

168
Vistas
Firefox problem closing input <type = "colour">

I am using colour picker in my project using input <type = "colour">. While using Chrome everything works fine, Colour picker can be closed by clicking on any part of the browser and also when i refresh or close the current tab. However, in case of firefox browser there is a very specific close button to close the colour picker and when i refresh or close the current tab the colour picker still remains there unless i close it using the respective button.

I came across a solution mentioned in How to close an html5 color picker? but the following solution is not effective for firefox either:

var input = document.getElementById('my-color');

// when you click the color picker, we'll run our code to close it after 2 seconds.
input.addEventListener('focus', function() {
  setTimeout(()=>{
  
    // toggle the type attribute to close the picker!
    input.setAttribute('type','text');
    input.setAttribute('type','color');
    
  }, 2000);
});

<input type="color" value="#ffaacc" id="my-color"/> <- Click me

How can i replicate the chrome behaviour for firefox as well?

about 4 years ago · Juan Pablo Isaza
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