File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/lib/TranscriptEditor/TimedTextEditor Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -494,16 +494,17 @@ class TimedTextEditor extends React.Component {
494494 // TODO: using convertToRaw here might be slowing down performance(?)
495495 const contentStateConvertEdToRaw = convertToRaw ( contentState ) ;
496496 const blocks = contentStateConvertEdToRaw . blocks ;
497+ const entityMap = contentStateConvertEdToRaw . entityMap ;
497498
498499 for ( var blockIdx in blocks ) {
499500 const currentBlock = blocks [ blockIdx ] ;
500501 const blockKey = currentBlock . key ;
501- const words = currentBlock . data . words ;
502502 const ranges = currentBlock . entityRanges ;
503503
504- for ( var idx in words ) {
504+ for ( var idx in ranges ) {
505505 const range = ranges [ idx ] ;
506- const word = words [ idx ] ;
506+ // Need to access entityMap and not currentBlock.data.words, as it seems to be not in sync with edits.
507+ const word = entityMap [ range . key ] . data ;
507508
508509 if ( word . start <= this . props . currentTime ) {
509510 currentFocus . blockKey = blockKey ;
You can’t perform that action at this time.
0 commit comments