AmruthPillai / Reactive-Resume

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!
https://rxresu.me
MIT License
20.72k stars 2.2k forks source link

Type Error in Picture Configuration Options #1902

Open Nikhil-Singhal-06 opened 1 month ago

Nikhil-Singhal-06 commented 1 month ago

Is there an existing issue for this?

Product Variant

Cloud (https://rxresu.me)

Current Behavior

In the Basics section, under the picture configuration options, when a user clicks on the already selected aspect ratio or border radius, a type error is thrown.

Expected Behavior

The application should simply recognize the selection as already active and maintain the current state.

Steps To Reproduce

No response

What browsers are you seeing the problem on?

Chrome

What template are you using?

None

Anything else?

No response

DemaPy commented 1 month ago

@AmruthPillai Hi, I found where problem lies. You just have to add additional check if value is toggled. If user click on the same value aspect ratio again, value will be empty string,

Currently selected: 0.75 which is portrait. Which is result undefined here; const stringToRatioMap = { square: 1, portrait: 0.75, horizontal: 1.33, } as const; const onAspectRatioChange = (value: AspectRatio) => { setValue("basics.picture.aspectRatio", stringToRatioMap[value]); };

Screenshot 2024-05-22 122618

Also I found another one issue with input, for aspect ratio. When input is empty. (Patch request failed every time when user clear input to change aspect ratio)

DemaPy commented 1 month ago

@AmruthPillai I have created pull request: https://github.com/AmruthPillai/Reactive-Resume/pull/1909