@@ -19,11 +19,11 @@ import './match_image_ui';
1919import './matches_table_ui' ;
2020
2121import { css , html , LitElement } from 'lit' ;
22- import { customElement , property } from 'lit/decorators.js' ;
22+ import { customElement , property , query } from 'lit/decorators.js' ;
2323
2424import { BatchSelection } from './batch_selection' ;
25- import { Batch , FieldId } from './entry' ;
2625import { EventType , listen } from './events' ;
26+ import { MatchImageUi } from './match_image_ui' ;
2727import { State } from './state' ;
2828import { getRdModeHash } from './state_hash' ;
2929
@@ -38,9 +38,15 @@ export class MatchesUi extends LitElement {
3838 @property ( { attribute : false } ) batchSelection ! : BatchSelection ;
3939 @property ( { attribute : false } ) matchIndex ! : number | undefined ;
4040
41+ @query ( 'match-image-ui' ) private readonly matchImageUi ! : MatchImageUi ;
42+
4143 override connectedCallback ( ) {
4244 super . connectedCallback ( ) ;
4345 listen ( EventType . MATCHED_DATA_POINTS_CHANGED , ( ) => {
46+ // batchSelection and matchIndex may stay the same, while the underlying
47+ // data points changed, so this.matchImageUi could display the wrong
48+ // image. Explicitly update it in this case.
49+ this . matchImageUi . requestUpdate ( ) ;
4450 this . requestUpdate ( ) ;
4551 } ) ;
4652 }
0 commit comments