Skip to content

timeslider follow content: Cannot read property 'offsetTop' of undefined #4389

@webzwo0i

Description

@webzwo0i

Describe the bug
Introduced with bf24063
The timeslider cannot display the contents in certain situations and errors, so that timeslider play or backwards/forwards buttons do not work anymore
To Reproduce
Steps to reproduce the behavior:

  1. Create pad
  2. Delete everything (ctrl+a, delete)
  3. Press enter
  4. goto timeslider, activate "follow pad contents"
  5. it errors when going from revision 1 to 2, and when going from 1 to 0.

Error is:
timeslider.js?callback=require.define&v=33c0661d:6342 Uncaught TypeError: Cannot read property 'offsetTop' of undefined at goToLineNumber (timeslider.js?callback=require.define&v=33c0661d:6342) at applyChangeset (timeslider.js?callback=require.define&v=33c0661d:6004) at Function.goToRevision (timeslider.js?callback=require.define&v=33c0661d:6099) at Array.goToRevisionIfEnabled (timeslider.js?callback=require.define&v=33c0661d:6309) at _callSliderCallbacks (timeslider.js?callback=require.define&v=33c0661d:6401) at setSliderPosition (timeslider.js?callback=require.define&v=33c0661d:6470) at HTMLButtonElement.<anonymous> (timeslider.js?callback=require.define&v=33c0661d:6693) at HTMLButtonElement.dispatch (ace2_common.js?callback=require.define&v=33c0661d:5492) at HTMLButtonElement.elemData.handle (ace2_common.js?callback=require.define&v=33c0661d:5300)

In the case of revision 1 to 2: in rev 1 the pad contains one line ("\n") and the changeset in rev 2 inserts another one and goToLineNumber will try to go to line 2 and fail.
In the case of revision 1 to 0: in rev 1 the pad contains one line ("\n") and the changeset for 0 will insert 7 lines for the default pad text. goToLineNumber will try to go to line 8 and fail.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions