Project

General

Profile

Bug #2869

Shortcut keys for next verse act weird

Added by Luke Murphey almost 4 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
03/21/2021
Due date:
% Done:

100%

History

#1 Updated by Luke Murphey almost 3 years ago

Repro:
  • Open work
  • Press Shift+right several times; note that it moves several chapters

#2 Updated by Luke Murphey almost 3 years ago

Uncaught TypeError: Cannot read properties of null (reading 'next_chapter')

#3 Updated by Luke Murphey almost 3 years ago

Questions:

  • What is the related stack trace?
    • readingMenuBar::upHandler()
  • Is the handler not getting removed properly?
  • Is the problem due to not having an empty array of dependencies after useEffect?
  • When does useEffect()'s cleanup get called?
  • Does this improve if I only add the handler if both goToNextChapter and goToPriorChapter are set?
    • No change
  • Does this work if I keep the handler around and only apply it if doesn't yet exist?
    • No change
Observations:
  • upHandler() is getting called several times
  • addHandler() gets called 7 times on a normal load
    • removeHandler() gets called 6 times
  • It looks like the handlers are not getting removed
    • getEventListeners(window).keyup.length
    • These keep increasing
Conclusion:
  • I wasn't deregistering the handlers correctly

#4 Updated by Luke Murphey almost 3 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF