Skip to content

fix(settings): prevent fps input from resetting (@Rajparikh18)#8130

Open
Rajparikh18 wants to merge 3 commits into
monkeytypegame:masterfrom
Rajparikh18:fix/fps-input-reset
Open

fix(settings): prevent fps input from resetting (@Rajparikh18)#8130
Rajparikh18 wants to merge 3 commits into
monkeytypegame:masterfrom
Rajparikh18:fix/fps-input-reset

Conversation

@Rajparikh18

@Rajparikh18 Rajparikh18 commented Jun 17, 2026

Copy link
Copy Markdown

Description

Fixes: #8119

Problem

The FPS input was resetting, even after giving input to it and saving it, once the page is refreshed it shows empty field there again.

Cause

The FPS input always shows empty field , just because the by default value of the fpsLimit is an empty string ( "")

Fix

Updated the FPS input handling by adding String(getfpsLimit()) this instead of "" so that valid user-entered values are preserved instead of being reset. The input now correctly reflects the saved FPS value after interacting with the field.

defaultValues: { fpsLimit: String(getfpsLimit()), },

Testing
Open Settings and search for "animation fps limit".
Enter a custom FPS value.
Click away from the input.
Once it is saved,
Refresh the page and verify that the saved value is still displayed correctly.

EDIT: addressed the issue , added a conditional statement, so that the input will not show 1000 and added a if statement to remove the "must be a number" error when selected native

Copilot AI review requested due to automatic review settings June 17, 2026 19:21
@monkeytypegeorge monkeytypegeorge added the frontend User interface or web stuff label Jun 17, 2026
@github-actions github-actions Bot added the waiting for review Pull requests that require a review before continuing label Jun 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR pre-populates the Animation FPS limit setting input with the currently saved FPS limit value instead of starting blank.

Changes:

  • Initialize the form’s fpsLimit default value from getfpsLimit() (stringified) rather than "".

Comment thread frontend/src/ts/components/pages/settings/custom-setting/AnimationFpsLimit.tsx Outdated
@fehmer

fehmer commented Jun 17, 2026

Copy link
Copy Markdown
Member

Hi @Rajparikh18 , thank you for your contribution.

Reloading the settings page with fps limit set to native shows

image

input field should be empty.

when setting custom value and pressing "native" an error is show but shouldnt:

image

@fehmer fehmer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

see comment

@github-actions github-actions Bot added waiting for update Pull requests or issues that require changes/comments before continuing and removed waiting for review Pull requests that require a review before continuing labels Jun 17, 2026
@github-actions github-actions Bot removed the waiting for update Pull requests or issues that require changes/comments before continuing label Jun 18, 2026
@Rajparikh18 Rajparikh18 requested a review from fehmer June 18, 2026 07:25
@github-actions github-actions Bot added the waiting for review Pull requests that require a review before continuing label Jun 18, 2026
@github-actions github-actions Bot removed the waiting for review Pull requests that require a review before continuing label Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend User interface or web stuff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Animation fps limit setting doesn't reset on blur

4 participants