File tree Expand file tree Collapse file tree
src/LiveDevelopment/BrowserScripts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1219,8 +1219,12 @@ function RemoteFunctions(config = {}) {
12191219 SHARED_STATE . _hotCorner . updateState ( config . mode === 'preview' , true ) ;
12201220 }
12211221
1222+ // Clear highlights when sync is turned off
1223+ const syncTurnedOff = oldConfig . syncSourceAndPreview !== false &&
1224+ config . syncSourceAndPreview === false ;
1225+
12221226 // Handle configuration changes
1223- if ( highlightModeChanged || isModeChanged ) {
1227+ if ( highlightModeChanged || isModeChanged || syncTurnedOff ) {
12241228 _handleConfigurationChange ( ) ;
12251229 }
12261230
@@ -1229,8 +1233,8 @@ function RemoteFunctions(config = {}) {
12291233 // doesn't clear the element highlighting.
12301234 const selectedBeforeReregister = previouslySelectedElement ;
12311235 registerHandlers ( ) ;
1232- if ( ! isModeChanged && ! highlightModeChanged && selectedBeforeReregister
1233- && config . mode === 'edit' ) {
1236+ if ( ! isModeChanged && ! highlightModeChanged && ! syncTurnedOff
1237+ && selectedBeforeReregister && config . mode === 'edit' ) {
12341238 // Restore the click highlight for the previously selected element
12351239 if ( ! _clickHighlight ) {
12361240 _clickHighlight = new Highlight ( true ) ;
You can’t perform that action at this time.
0 commit comments