suryanshsingh2001 / mockly

Mockly is an open-source tool that allows developers to create professional-looking screenshots and mockups with ease. It's designed for fast, stress-free mockups for developers who'd rather code than design.
https://www.mockly.site/
MIT License
5 stars 15 forks source link

Fix/removing NaN for shadow #25

Closed rahulchaudhary2244 closed 1 month ago

rahulchaudhary2244 commented 1 month ago

Pull Request Template

Description

This PR addresses the issue where clearing the Blur property in the Shadow settings results in "NaN" being displayed on the UI. It is essential to handle this case appropriately to improve the user experience and ensure that "NaN" is not shown to the users.

Closes https://github.com/suryanshsingh2001/mockly/issues/23

Changes Made

Type of Change

Screenshots

image

How Has This Been Tested?

Checklist

Check off the following items before submitting the pull request:

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mockly ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 3, 2024 8:30am
rahulchaudhary2244 commented 1 month ago

Hi @suryanshsingh2001 , Could you please take a look at my PR when you have some time? Also, it would be great if you could add the hacktoberfest-accepted label to ensure it gets counted for the event.

rahulchaudhary2244 commented 1 month ago

Hey, I reviewed the code, and it looks like this is already handled— the minimum value for the border radius is set to not go below 0.

image
suryanshsingh2001 commented 1 month ago

Hey, I reviewed the code, and it looks like this is already handled— the minimum value for the border radius is set to not go below 0.

image

https://github.com/user-attachments/assets/e3e61aed-5de3-4a96-b352-513a02dc798c

@rahulchaudhary2244 Please have a look, using the arrows still allowing negative values. But, yes otherwise it defaults to zero.

rahulchaudhary2244 commented 1 month ago

Oh, I see now! You were referring to the Blur value—my mistake, I thought you meant border-radius. You're right, this needs to be fixed. I'll take care of it.

rahulchaudhary2244 commented 1 month ago

Hi @suryanshsingh2001 , this should be good now.

suryanshsingh2001 commented 1 month ago

Oh, I see now! You were referring to the Blur value—my mistake, I thought you meant border-radius. You're right, this needs to be fixed. I'll take care of it.

My apologies for the confusion 😅!

rahulchaudhary2244 commented 1 month ago

@suryanshsingh2001 , I believe we should introduce unit tests or integration tests to prevent issues like these edge cases from slipping through in the future. What do you think ?

suryanshsingh2001 commented 1 month ago

@suryanshsingh2001 , I believe we should introduce unit tests to prevent issues like these edge cases from slipping through in the future. What do you think ?

You are right; however, I’m not familiar with a lot of testing. Please let me know how to approach this.