Skip to content
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

p-image does not allow src to be of type SafeUrl #11143

Closed
ramonvanbezouw opened this issue Feb 7, 2022 · 1 comment · Fixed by #11144
Closed

p-image does not allow src to be of type SafeUrl #11143

ramonvanbezouw opened this issue Feb 7, 2022 · 1 comment · Fixed by #11144
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@ramonvanbezouw
Copy link
Contributor

I'm submitting a ...

[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Current behavior

<p-image [src]="sanitizer.bypassSecurityTrustUrl(base64EncodedImage)"></p-image>

Throws a type error Type 'SafeUrl' is not assignable to type 'string' due to the src Input Decorator only accepting values of type string.

What is the motivation / use case for changing the behavior?
Supporting the SafeUrl type would make the p-image component compatible with the underlying Angular src directive on the image element, which does support the SafeUrl type.

  • Angular version: 13.1

  • PrimeNG version: 13.1

  • Browser: all

  • Language: all

@ramonvanbezouw
Copy link
Contributor Author

PR here: #11144

@cetincakiroglu cetincakiroglu self-assigned this Feb 7, 2022
@cetincakiroglu cetincakiroglu added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Feb 7, 2022
@cetincakiroglu cetincakiroglu linked a pull request Feb 8, 2022 that will close this issue
@yigitfindikli yigitfindikli added this to the 13.1.2 milestone Feb 11, 2022
@yigitfindikli yigitfindikli added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Status: Pending Review Issue or pull request is being reviewed by Core Team labels Feb 11, 2022
@yigitfindikli yigitfindikli self-assigned this Feb 11, 2022
yigitfindikli added a commit that referenced this issue Feb 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants