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

[apps/picker] input number step setting #330

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

sidewayss
Copy link
Contributor

The <input type="number"> that floats above the color sliders doesn't have the step attribute set, so it's always set to 1. This fix should set it to the correct resolution. The italics are because I have not figured out how to view the page with these changes. Sorry about that. I'm new to npm and I ran npm run watch:html but then I didn't know what port to use or how to view the changes in a browser. Github Pages won't build a site either. I'm also unfamiliar with the ":attribute" syntax, as in :style="...". The <input type="range"> right above the number spinner sets this same property this same way, so this seems to me like a viable fix.

If you want to reproduce this as a problem, select any RGB color space and try to change a value using one of these inputs. It displays 0.XXX but the step is set to 1, so if you click on either spin button it sets to value to 0 or 1 immediately.

Also note: On both Chrome and Firefox in Windows, the spinner buttons crowd the numbers. Part of the problem is that the numbers are not truncated/rounded and can have lots of decimals, but the control should be a bit wider regardless. I didn't see any styling for it. Maybe the width is set via "https://stretchy.verou.me/dist/stretchy.iife.min.js"?

If someone points me in the right direction I can amend this PR to include a rounding or truncating of these numbers to the precision set by the precision input or to some fixed value. If it's set to the user setting, then the width will have to adjust accordingly.

@svgeesus
Copy link
Member

svgeesus commented Feb 5, 2024

@LeaVerou LeaVerou merged commit 35a6ac5 into color-js:main Feb 6, 2024
4 checks passed
@LeaVerou
Copy link
Member

LeaVerou commented Feb 6, 2024

Thank you @sidewayss!!

@sidewayss
Copy link
Contributor Author

Glad to see that it works, and without any edits. I was making a semi-educated guess.

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

Successfully merging this pull request may close these issues.

3 participants