- Home
- Forum
- JavaScript - EJ 2
- Selection moveToDocumentEditor not scrolling until the end
Selection moveToDocumentEditor not scrolling until the end
Hello,
For our application, we would like to be able to move programatically to the document start and to the document end, one right after the other. However, doing so with pasted content will prevent the editor from scrolling all the way to the document end. If a timeout is added between moving to start and end, this issue is not present.
I have prepared a simple demo with 2 buttons, one that applies said timeout between calling selection.moveToDocumentStart and selection.moveToDocumentEnd, and one that doesn't:
https://stackblitz.com/edit/i6ebkt?file=index.html
Please let me know if there is anything I can help with regarding this issue.
Best regards,
Daniel Souza
Hi Daniel Souza,
It seems that you
are pasting the content and then immediately you are trying to move the
selection to document Start and End. In General, the paste API takes certain
time to complete its action of re-layouting and rendering the contents and
moves the selection to end of the pasted content. So if you provide timeout
functionality after paste operation, it works properly for again moving the selection to document
start and end.
It would be more
helpful for us, if you can provide your exact requirement on which scenario you
are trying to accomplish this use case, so that we can validate it further and
provide you with the necessary solutions.
Regards,
Suresh I
Hello Suresh,
Thank you for the reply.
Our use case is that our user has access to document templates, which are pre-made documents saved as SFDT. We have some cases where we use the open command as well, but we must use the paste for this case. The user also has a default font-family and other formatting options. However, when the user loads this template we want the formatting options to remain as set in the template. For that, we check the formatting at the start of the document. After all this is done, we want to navigate to the end of the document, which is the preferred initial position after loading a template.
When we first stumbled on this issue, we speculated the paste command might be async, but we have tested this case and this does not seem to be the problem, at least, on a simple demo. I have updated the demo code to showcase this: https://stackblitz.com/edit/i6ebkt-kkz2mn?file=index.ts
You now have two buttons that try to paste and move around the document using timeouts. The first one, which works, sets that timeout after moving to the document start. The second one, after pasting, as to handle any async behavior from the paste command. However, even after waiting 5 seconds for the paste to run, we still are unable to navigate from document start to end consecutively.
Thank you for your attention to this matter.
Best regards,
Daniel Souza
Hi Daniel Souza,
We are currently validating the reported issue. We will get back to you with further details on Aug 14, 2024.
Regards,
Suresh I
Daniel , We will update details shortly.
Hello Suriya,
Any updates on this issue?
Best regards,
Daniel Souza
Daniel, We have confirmed the reported issue 'Selection moveToDocumentEditor not scrolling until the end' as a defect and logged a defect report. We will include this fix in our first weekly release after 2024 Volume 3 main release which is expected on mid of September, 2024. We will provide a custom package for this fix if we complete it earlier.
You can track the status of the bug through the below feedback link:
https://www.syncfusion.com/feedback/60418/resolve-the-scroll-bar-issue
Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”
Hi Daniel Souza,
We are glad to announce that our patch release (v27.1.51) has been rolled out successfully. In this release, we have added the fix for the issue 'Selection moveToDocumentEditor not scrolling until the end'.
Please upgrade to the latest version packages to resolve this issue:
NPM link:
https://www.npmjs.com/package/@syncfusion/ej2-documenteditor
https://www.npmjs.com/package/@syncfusion/ej2-react-documenteditor
https://www.npmjs.com/package/@syncfusion/ej2-angular-documenteditor
NuGet links:
https://www.nuget.org/packages/Syncfusion.Ej2.Wordeditor.ASPNet.Core/
https://www.nuget.org/packages/Syncfusion.Ej2.Wordeditor.ASPNet.MVC5/
Feedback link:
https://www.syncfusion.com/feedback/60418/resolve-the-scroll-bar-issue
Please let us know if you need any further assistance.
Root cause:
Following the completion of moveToDocumentStart(), the updateScrollbar method should reset the container's top value. However, this reset is currently not happening(Due to continuous calls to both moveToDocumentStart() and moveToDocumentEnd() methods, the container's top value is not being reset correctly by the updateScrollbar method).
Regards,
Mohammed Kaif S
- 7 Replies
- 4 Participants
- Marked answer
-
DS Daniel Souza
- Aug 8, 2024 12:36 PM UTC
- Oct 3, 2024 09:31 AM UTC