question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hide `x` buttons in settings color picker when control is already set to the default

See original GitHub issue

Description https://github.com/foxglove/studio/pull/4060 introduced the ability to “clear” color fields, resetting them to the default.

Unfortunately, this leads to some instances where I have an x button that does nothing when clicked, because the field is already at the default.

image

I think we should hide the x button when a field is already set to its default value.

According to https://github.com/foxglove/studio/pull/4060#issuecomment-1213346122, “default” is not actually a concept, we just send undefined to the panel and let it figure out how it wants to handle things.

It’s up to the panel implementor. They’ll receive an incoming value of undefined but can process that however they want. In the case of that panel it’s reverting it to the panel’s own concept of the default. But at the level of the settings ui there’s no “default” value.

Therefore, to fix this we may need to introduce a concept of “default” for controls like this. Opening up for discussion.

cc @foxymiles @2metres

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
jtbandescommented, Aug 12, 2022

On a separate note I think the x button should maybe be gray instead of purple. It’s a very inviting button when it’s purple, but probably not something we expect people would need too often.

0reactions
amacneilcommented, Aug 13, 2022

This might be a good topic for product review. We can talk through the various competing goals here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

24 Color Picker - Using JavaFX UI Controls
Using a Color Picker​​ Example 24-1 shows three ways to declare a ColorPicker object. //Empty contructor, the control appears with the default color,...
Read more >
PowerToys Color Picker utility for Windows - Microsoft Learn
A system-wide color picking utility for Windows that enables you to pick colors from the screen and automatically copies the default value ...
Read more >
<input type="color"> - HTML: HyperText Markup Language
<input> elements of type color provide a user interface element that lets a user specify a color, either by using a visual color...
Read more >
Simonwep/pickr - GitHub
Flat, simple, multi-themed, responsive and hackable Color-Picker library. No dependencies, no jQuery. Compatible with all CSS Frameworks e.g. Bootstrap, ...
Read more >
Spectrum - The No Hassle jQuery Colorpicker - bgrins
You can show or hide the buttons using the showButtons property. If there are no buttons, the behavior will be to fire the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found