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

Image add support for onError and onLoad callback #5945

Merged

Conversation

skathuria29
Copy link
Member

@skathuria29 skathuria29 commented Feb 26, 2024

Closes Github issue # 5905

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

Copy link
Member

@reidbarber reidbarber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the addition, and test+story!

You'll need to sign the CLA for the build to pass.

packages/@react-types/image/src/index.d.ts Outdated Show resolved Hide resolved
@skathuria29 skathuria29 reopened this Feb 27, 2024
@skathuria29
Copy link
Member Author

skathuria29 commented Feb 27, 2024

Thanks for the addition, and test+story!

You'll need to sign the CLA for the build to pass.

hey @reidbarber I'm not an external contributor. I have raised request to add company to my public GitHub profile. Waiting for approval. Please let me know in case anything else is also required.

@skathuria29 skathuria29 marked this pull request as ready for review February 27, 2024 10:13
@skathuria29 skathuria29 reopened this Feb 28, 2024
Copy link
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're going to support onError then we should also support onLoad, would you mind adding it?

packages/@react-spectrum/image/docs/Image.mdx Outdated Show resolved Hide resolved
@skathuria29
Copy link
Member Author

@snowystinger @reidbarber Please review the changes.

@snowystinger
Copy link
Member

GET_BUILD

@rspbot
Copy link

rspbot commented Mar 5, 2024

packages/@react-spectrum/image/docs/Image.mdx Outdated Show resolved Hide resolved
packages/@react-types/image/src/index.d.ts Outdated Show resolved Hide resolved
packages/@react-types/image/src/index.d.ts Outdated Show resolved Hide resolved
snowystinger
snowystinger previously approved these changes Mar 6, 2024
@snowystinger
Copy link
Member

GET_BUILD

@rspbot
Copy link

rspbot commented Mar 6, 2024

@rspbot
Copy link

rspbot commented Mar 6, 2024

## API Changes

unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any', access: 'private' }
unknown top level export { type: 'any', access: 'private' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }

@react-spectrum/image

Image

 SpectrumImageProps {
   alt?: string
   objectFit?: any
+  onError?: ReactEventHandler<HTMLImageElement>
+  onLoad?: ReactEventHandler<HTMLImageElement>
   slot?: string = 'image'
   src: string
 }

@skathuria29
Copy link
Member Author

skathuria29 commented Mar 6, 2024

@reidbarber Please review and merge the changes

Copy link
Member

@reidbarber reidbarber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@reidbarber reidbarber merged commit 716b6ba into adobe:main Mar 6, 2024
27 checks passed
@skathuria29 skathuria29 changed the title Image add support for onerror callback Image add support for onError and onLoad callback Mar 14, 2024
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.

None yet

4 participants