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

setDragImage type signature causing BigInt conversion issue #284

Closed
chancyk opened this issue Mar 14, 2024 · 2 comments
Closed

setDragImage type signature causing BigInt conversion issue #284

chancyk opened this issue Mar 14, 2024 · 2 comments

Comments

@chancyk
Copy link
Contributor

chancyk commented Mar 14, 2024

Any idea why the signature for setDragIamge uses int64? It exists in both the Nim dom module and kdom_impl here.

https://github.com/nim-lang/Nim/blob/78c834dd76f273d8813247647531005a1f7db1a6/lib/js/dom.nim#L1658

proc setDragImage*(dt: DataTransfer, img: Element, xOffset: int64, yOffset: int64)

It seems to be causing this error in the browser: Uncaught TypeError: Cannot convert a BigInt value to a number
Due to emitting 0n instead of 0: dev_704645398.dataTransfer.setDragImage(overlay_704645399, 0n, 0n);

Converting it to int seems to solve the issue for me.

@Araq
Copy link
Collaborator

Araq commented Mar 14, 2024

Good point, please fix it.

ringabout pushed a commit to nim-lang/Nim that referenced this issue Mar 15, 2024
Problem described here: karaxnim/karax#284

Co-authored-by: Chancy Kennedy <chancy@conciergecloset.com>
@ringabout
Copy link
Collaborator

fixed by #286

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

No branches or pull requests

3 participants