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

Fix wrong id type in DndEventInfo #453

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shueja
Copy link

@shueja shueja commented Jun 23, 2023

When logging e.detail.info it shows that id is a number, just like in the items list. However, the typings show DndEventInfo.id to be a string, which is incorrect.

@isaacHagoel
Copy link
Owner

the id would be whatever was passed in to the lib, no? as in if u pass in a string it will be a string if u pass in a number it will be a number

@shueja
Copy link
Author

shueja commented Jun 23, 2023

The examples all use numbers, so I figured that id was required to be a number. Looking at the typings it's not even enforced that Item has an id property. Either way, the typings expect id in DndEventInfo to be a string, with no regard to what is passed into the library. To my knowledge, there's not a super good way to make DndEventInfo expect an id type that matches the item type, but that would be the ideal.

@isaacHagoel
Copy link
Owner

I agree that it would be ideal if possible, and i think that in most real life cases it would be a string (but enforcing it might break existing users)

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.

2 participants