File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -129,17 +129,16 @@ export const MovesContainer: React.FC<
129129 break
130130 case 'ArrowLeft' :
131131 event . preventDefault ( )
132- if ( controller . currentNode . parent ) {
133- // Check if navigation is restricted
134- if (
135- restrictNavigationBefore &&
136- controller . currentNode . parent . fen === restrictNavigationBefore . fen
137- ) {
138- // Don't navigate before the restriction point
139- return
140- }
141- controller . goToNode ( controller . currentNode . parent )
132+ if ( ! controller . currentNode ?. parent ) return
133+ // Treat restrictNavigationBefore as the earliest allowed node
134+ if (
135+ restrictNavigationBefore &&
136+ controller . currentNode . fen === restrictNavigationBefore . fen
137+ ) {
138+ // Already at the boundary; do not go earlier
139+ return
142140 }
141+ controller . goToNode ( controller . currentNode . parent )
143142 break
144143 default :
145144 break
You can’t perform that action at this time.
0 commit comments