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

Make TextField more float frendly #288

Closed
untlsn opened this issue Dec 2, 2023 · 2 comments · Fixed by #354
Closed

Make TextField more float frendly #288

untlsn opened this issue Dec 2, 2023 · 2 comments · Fixed by #354

Comments

@untlsn
Copy link

untlsn commented Dec 2, 2023

Currently, it is not possible to put a dot at the end of the input when the type is number. And from what I understand, it's a problem on the browser side, because target.value removes the dot at the end. So is it acceptable to ignore the change when target.value are the same?

// Inside text-field-input.tsx
onInput={(ev) => {
	const target  = ev.target as HTMLInputElement;
	if (target.value == context.value()) return;
	local.onInput?.(ev);
	context.onInput?.(ev);
}}
@probably-neb
Copy link

@untlsn, Thanks! The fix you proposed is working correctly for me. I'd be happy to open a pr for this if you're not interested in doing so

@jer3m01
Copy link
Member

jer3m01 commented Mar 5, 2024

<TextField/> is only intended for strings, for numbers (including any unit/formatting) use <NumberField/>.

@jer3m01 jer3m01 linked a pull request Mar 5, 2024 that will close this issue
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 a pull request may close this issue.

3 participants