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

update position before firing onChange #109

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

CVChrisWilson
Copy link

This allows you to use shorthand widget.fen() and get the FEN string that matches Chessboard.objToFen(newPos) within the onChange event. Without it calling widget.fen() within the onChange() event returns the value that matches Chessboard.objToFen(oldPos).

CVChrisWilson and others added 4 commits October 6, 2015 23:58
Seems impossible to get the updated fen string on trash/drop without
this. (I'm printing the fen string out on any user activity).
Enables widget.fen() to pass the current fen string when the onChange
event is called.
objToFen(oldPos/newPos) still return expected values.
I think this was the issue all along.
<code>Chessboard.objToFen(oldPos)</code> was returning the newPos and
vice versa.
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.

1 participant