Scroll to the bottom of the ticket note is emitted during editing after pressing DELETE (keycode 46) | Community
Skip to main content

Scroll to the bottom of the ticket note is emitted during editing after pressing DELETE (keycode 46)

  • January 19, 2021
  • 0 replies
  • 0 views

I recently come across an issue with Zendesk Support product. When DELETE button (keyCode 46) is pressed on the empty line (CRLF) during ticket note editing, a scroll event is emitted and the view goes to the bottom of the internal note. 

Steps to reproduce:

1. Open a support ticket and fill in the note with text having empty lines long enough to have a scroll bar

2. Place the caret on the blank line and press DELETE

As a result, a scroll event is emitted and the view goes to the bottom of the note. However, the cursor caret stays where it was. 

I took some time to debug the issue and the execution flow was done in the following order leading to the scroll event. 

https://static.zdassets.com/agent/assets/application-3bc0a0f28837e700a5583bfbcf9345a5.js
https://static.zdassets.com/agent/assets/react/js/vendor.af10c4ab213d7538e.js
https://static.zdassets.com/agent/assets/react/js/1.a4b6e3bd5d6d57ca8.chunk.js
https://static.zdassets.com/agent/assets/react/js/app.aff09ccb7cc7855cb.js
debugger:///VM213 shortcut.js
https://static.zdassets.com/agent/assets/vendor-e12de7d83ca9ce086b76f9882f4e764d.js
https://static.zdassets.com/agent/assets/react/js/vendor.af10c4ab213d7538e.js
https://static.zdassets.com/agent/assets/application-3bc0a0f28837e700a5583bfbcf9345a5.js
https://static.zdassets.com/agent/assets/react/js/vendor.af10c4ab213d7538e.js
https://static.zdassets.com/agent/assets/react/js/2.a5bd806f51f0cf85e.chunk.js

The code is minified, however, it leads to the following line before the scroll happens with n.current = 0.

Object(i.useEffect)(()=>{var a=t.current,r=!1,i=()=>{t.current&&(t.current.scrollTop=n.current),r=!1},o=()=>{r=!0,LE?requestAnimationFrame(i):i()},c=()=>{r||(n.current=t.current.scrollTop)}

Another thing to mention is that using BACKSPACE (keyCode 8) doesn't lead to the same issue.

I hope this information helps and the issue can be resolved.