fix(android): Setting String Value to Width And Height by db-r-hashimoto · Pull Request #10668 · NativeScript/NativeScript · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

fix(android): Setting String Value to Width And Height #10668

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.