Khan / Khan/live-editor

TypeError is thrown when you try to use keyTyped after removing keyPressed/keyReleased callback functions

Open
#421 7 comments 0 reactions 1 assignee Claimed by @k4b7 View on GitHub
bug pjs
Dominant language
JavaScript
Stars
776
Forks
180
PR merge metrics
No merged PRs in 30d

Description

To reproduce:
- Open your Javascript console.
- Navigate to [this program](https://www.khanacademy.org/computer-programming/notepad-wip/6665063086161920)
- Select all of the code with `Ctrl+A` (or `Cmd+A`); and delete the code.
- Copy and paste [this code](https://gist.github.com/Gigabyte-Giant/0de4c14a8dc1baddea35) into the program.
- Shift browser focus to the program (by clicking on the canvas), and press a key on your keyboard.
- **Observe the error**.

I assume the scratchpad is still trying to invoke the (previously user-defined) callbacks `keyPressed` and `keyReleased`?

Though I haven't tested yet, I assume the same thing will occur with `mouseClicked` (_if_ the original program had defined callback functions for `mousePressed` and `mouseReleased`).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.