Skip to content

Commit

Permalink
Fixed GameActionsDropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
programarivm committed Mar 22, 2024
1 parent 3f5a7d7 commit d871197
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/GameActionsDropdown.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { COLOR } from "https://cdn.jsdelivr.net/npm/[email protected]/src/Chessboard.js";
import { Movetext } from '../src/common/Movetext.js';
import AbstractComponent from '../src/AbstractComponent.js';

export class GameActionsDropdown extends AbstractComponent {
Expand All @@ -12,7 +13,8 @@ export class GameActionsDropdown extends AbstractComponent {

this._el.children.item(1).addEventListener('click', (event) => {
event.preventDefault();
navigator.clipboard.writeText(this._props.movesTable.props.movetext);
const back = (this._props.movesTable.props.fen.length - this._props.movesTable.current - 1) * -1;
navigator.clipboard.writeText(Movetext.substring(this._props.movesTable.props.movetext, back));
});

this._el.children.item(2).addEventListener('click', (event) => {
Expand Down

0 comments on commit d871197

Please sign in to comment.