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

feat: support onSelect callback #238

Merged
merged 1 commit into from
Feb 23, 2023
Merged

feat: support onSelect callback #238

merged 1 commit into from
Feb 23, 2023

Conversation

mfklauberg
Copy link
Contributor

Adding back the onSelect property.

closes #237

@netlify
Copy link

netlify bot commented Feb 23, 2023

Deploy Preview for any-viewer ready!

Name Link
🔨 Latest commit af84ab3
🔍 Latest deploy log https://app.netlify.com/sites/any-viewer/deploys/63f7bf92b3bbc500086d7ae9
😎 Deploy Preview https://deploy-preview-238--any-viewer.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@pionxzh
Copy link
Collaborator

pionxzh commented Feb 23, 2023

I'm thinking about moving this logic to DataKeyPair so that customized value can also support onSelect event (ofc the user needs to implement onClick=props.onSelect). But we can merge this as a first version 😄

@mfklauberg mfklauberg requested a review from pionxzh February 23, 2023 19:34
@mfklauberg
Copy link
Contributor Author

mfklauberg commented Feb 23, 2023

I'm thinking about moving this logic to DataKeyPair so that customized value can also support onSelect event (ofc the user needs to implement onClick=props.onSelect). But we can merge this as a first version 😄

Before opening the issue and the PR, one of my options was to implement a custom values render to put a click event in the DOM, so I think that this is already possible today, just the event registered in the main component won't be the same and would need to be used in all custom rendered values.

Copy link
Collaborator

@pionxzh pionxzh left a comment

Choose a reason for hiding this comment

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

LGTM

@pionxzh pionxzh changed the title feat: add onSelect property feat: support onSelect callback Feb 23, 2023
@codecov
Copy link

codecov bot commented Feb 23, 2023

Codecov Report

Base: 87.41% // Head: 87.51% // Increases project coverage by +0.10% 🎉

Coverage data is based on head (af84ab3) compared to base (7d28011).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #238      +/-   ##
==========================================
+ Coverage   87.41%   87.51%   +0.10%     
==========================================
  Files          18       18              
  Lines        1971     1987      +16     
  Branches      350      352       +2     
==========================================
+ Hits         1723     1739      +16     
  Misses        248      248              
Impacted Files Coverage Δ
src/components/DataTypes/createEasyType.tsx 65.38% <100.00%> (+0.91%) ⬆️
src/index.tsx 99.37% <100.00%> (+<0.01%) ⬆️
src/stores/JsonViewerStore.ts 90.16% <100.00%> (+0.24%) ⬆️
src/type.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

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.

onSelect property removed v2.x
2 participants