Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@db-r-hashimoto
Copy link

PR Checklist

What is the current behavior?

Currently, when a string value is assigned to the width or height property of ImageAssetOptions, an error occurs on Android. This issue prevents users from specifying these properties as strings, which can be problematic in scenarios where string-based dimensions are used.

What is the new behavior?

With this update, assigning a string value to the width or height property of ImageAssetOptions no longer results in an error on Android. The system now properly handles string-based dimensions, providing a more flexible and consistent experience for users.

Fixes/Implements/Closes #6289 .

@CatchABus
Copy link
Contributor

CatchABus commented Jan 17, 2025

Let me point out that this looks like a requested feature.
Docs and TypeScript definitions (even if you use JavaScript) indicate that options will expect a type of number for dimensions so as long as you use it the right way, it will work.
Also, you can always make use of functions like parseInt or parseFloat to pass the value as a number.
Regarding the error, core could also be strict and print a warning message about it instead to let users know that one has to use numeric values.

Few things to point out:

  • Some linting rules like single quotes aren't being followed.

@db-r-hashimoto
Copy link
Author

@CatchABus Strings should use single quotes, as per the coding conventions outlined here. I'll fix it accordingly.

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 this pull request may close these issues.

Setting string value to width or height of ImageAssetOptions results in an error on android

2 participants