Skip to content

Commit

Permalink
Merge pull request lichess-org#17064 from johndoknjas/pgn-import
Browse files Browse the repository at this point in the history
Have a click unselect pgn text if already selected
  • Loading branch information
ornicar authored Feb 27, 2025
2 parents a2f11b4 + b943ce9 commit c1449af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ui/analyse/src/serverSideUnderboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ export default function (element: HTMLElement, ctrl: AnalyseCtrl) {
const selection = window.getSelection(),
range = document.createRange();
range.selectNodeContents(this);
const currentlyUnselected = selection!.isCollapsed;
selection!.removeAllRanges();
selection!.addRange(range);
if (currentlyUnselected) selection!.addRange(range);
});

$panels.on('click', '.embed-howto', function (this: HTMLElement) {
Expand Down

0 comments on commit c1449af

Please sign in to comment.