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

Do we need EyeDropper instances? #18

Open
annevk opened this issue Sep 22, 2021 · 9 comments
Open

Do we need EyeDropper instances? #18

annevk opened this issue Sep 22, 2021 · 9 comments

Comments

@annevk
Copy link

annevk commented Sep 22, 2021

It seems this could just be a method on navigator or some such. Or perhaps a static method on EyeDropper if we wanted to namespace it. @domenic probably knows what's modern.

@annevk annevk changed the title Do we need EyeDropper? Do we need EyeDropper instances? Sep 22, 2021
@jespertheend
Copy link

I've always found that new TextEncoder() seems weird and when I saw this api this was the first thing that came to mind as well. I think maybe an extension to navigator could work?

@domenic
Copy link

domenic commented Oct 21, 2021

I kind of assumed there was going to be some statefulness to the EyeDropper, perhaps in future (or previous?) revisions of the proposal. If that's the case then sticking with a class makes sense.

If there's no state and this is purely a function, then window.showColorPicker() would be my recommendation (similar to window.showOpenFilePicker()).

@annevk
Copy link
Author

annevk commented Oct 22, 2021

(FWIW, TextEncoder is that way for symmetry with TextDecoder, which has state.)

@beaufortfrancois
Copy link

beaufortfrancois commented Nov 10, 2021

@ipopescu93 What are your current thoughts?

As we're thinking about adding showPicker() to HTMLInputElement interfaces in whatwg/html#6909 to let web developers programmatically open pickers for color, file, and temporal input elements, we would be happy to have some consistency between method names.

window.showColorPicker() would be nice indeed if states are not needed.

@ipopescu93
Copy link
Collaborator

It is expected that state is going to be added for future capabilities of the EyeDropper like: UI customization, restricting the selectable area, etc.

@emilio
Copy link

emilio commented Nov 19, 2021

Why can't that be an options dictionary to the hypothetical showColorPicker function?

@jogibear9988
Copy link

it is already shipped, does any one think this will change any more?

@annevk
Copy link
Author

annevk commented Dec 15, 2021

It shipped in one browser only, I'm somewhat hopeful this can still be changed.

@zcorpan
Copy link

zcorpan commented Oct 16, 2024

Also see #35

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

8 participants