Brian Zelip
Brian Zelip

Reputation: 3191

How to get the same <input type="color"> value change functionality across browsers?

I'm working on a web app that uses javascript to do something on the page when a user chooses a color from an <input type="color">.

The problem is that <input type="color"> behaves differently on Chrome, Firefox, and Safari:

Chrome's behavior is ideal:

Here is a codepen with a vanilla <input type="color"> that demonstrates this problem when checked on all 3 browsers.

How to use javascript and/or css to get the <input type="color"> Chrome behavior out of Firefox and Safari?

EDIT The crazy thing about Safari is, their docs say that the color input type is:

An input control for specifying a RGB color value. The user can select a color from a color well

Upvotes: 2

Views: 627

Answers (1)

nbo
nbo

Reputation: 419

I am afraid we are not there yet to use this input type in development. Your best solution is to use a cross browser plugin.

You can see the support of the color element at http://caniuse.com/#search=color

Upvotes: 1

Related Questions