lichess-org / chessground

Mobile/Web chess UI for lichess.org
https://lichess.org
GNU General Public License v3.0
1.05k stars 261 forks source link

Update eraseOnClick logic #176

Closed rcpooley closed 3 years ago

rcpooley commented 3 years ago

Old Logic

Assuming white to move

eraseOnClick=true

ornicar commented 3 years ago

There must exist a reason why these conditions were added in the first place. What will removing them break?

niklasf commented 3 years ago

Since the default is true, the only place that is affected in lila is studies:

ui/analyse/src/ground.ts:      eraseOnClick: !ctrl.opts.study || !!ctrl.opts.practice,

There, clicking an empty square would no longer clear the drawings, exactly as you analyzed. However that's the behavior we want.

So it's really the name of this option that's misleading. It could have been called eraseOnAnyClick or eraseEvenOnMovablePieceClick.