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

Fix spinbox decimal issues when update_on_text_changed = true #100684

Merged

Conversation

ryevdokimov
Copy link
Contributor

@ryevdokimov ryevdokimov commented Dec 21, 2024

Fixes: #100620

When using update_on_text_changed:

If . is entered as the first character, automatically change to 0.
Text ending in . does not get submitted, unless "accepted".
Round numbers do not automatically have a decimal appended to it, unless "accepted".

2024-12-20.18-53-49.mp4

@ryevdokimov ryevdokimov requested a review from a team as a code owner December 21, 2024 02:36
@ryevdokimov ryevdokimov force-pushed the fix-spinbox-decimal-issues branch from 88c45ed to f5bd284 Compare December 21, 2024 02:59
@Chaosus Chaosus added this to the 4.4 milestone Dec 21, 2024
@KoBeWi
Copy link
Member

KoBeWi commented Jan 12, 2025

, is also supported in SpinBox, so you should probably account for that too.

@ryevdokimov ryevdokimov force-pushed the fix-spinbox-decimal-issues branch 3 times, most recently from 6eec5b4 to 2cf54be Compare January 14, 2025 17:54
@ryevdokimov ryevdokimov force-pushed the fix-spinbox-decimal-issues branch from 2cf54be to 0b7c9e2 Compare January 14, 2025 18:57
@ryevdokimov
Copy link
Contributor Author

, is also supported in SpinBox, so you should probably account for that too.

Done.

@ryevdokimov ryevdokimov force-pushed the fix-spinbox-decimal-issues branch from 0b7c9e2 to f72620b Compare January 14, 2025 19:09
@KoBeWi
Copy link
Member

KoBeWi commented Jan 25, 2025

When the number ends with period and you press Enter, the period will disappear resulting in wrong text. Pressing Enter again will update it correctly.

godot.windows.editor.dev.x86_64_U2TJsmHcSd.mp4

@ryevdokimov ryevdokimov force-pushed the fix-spinbox-decimal-issues branch from f72620b to b0bba3d Compare January 25, 2025 12:13
@ryevdokimov
Copy link
Contributor Author

When the number ends with period and you press Enter, the period will disappear resulting in wrong text. Pressing Enter again will update it correctly.

Fixed.

@KoBeWi
Copy link
Member

KoBeWi commented Jan 25, 2025

The initial value is missing trailing 0 for some reason.
image
Expected:
image

@ryevdokimov ryevdokimov force-pushed the fix-spinbox-decimal-issues branch from b0bba3d to 2e6a6d3 Compare January 26, 2025 06:26
@ryevdokimov
Copy link
Contributor Author

The initial value is missing trailing 0 for some reason.

Fixed.

Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works correctly now.

@ryevdokimov ryevdokimov force-pushed the fix-spinbox-decimal-issues branch from 2e6a6d3 to d8318de Compare February 1, 2025 17:31
@akien-mga akien-mga modified the milestones: 4.4, 4.5 Feb 12, 2025
@akien-mga akien-mga added the cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release label Feb 12, 2025
@Repiteo Repiteo merged commit 3a472ef into godotengine:master Mar 5, 2025
19 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Mar 5, 2025

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 4.4.1.

@akien-mga akien-mga removed the cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release label Mar 12, 2025
@ryevdokimov ryevdokimov deleted the fix-spinbox-decimal-issues branch March 14, 2025 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SpinBox update_on_text_changed = true regression: Can't input decimals.
7 participants