Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

substituteKeyboardEvents config option #30

Merged
merged 4 commits into from Jun 7, 2016

Conversation

laughinghan
Copy link
Collaborator

Lets API consumers override the keyboard events abstraction with a
wrapper around saneKeyboardEvents() that can intercept events and ignore
them or do stuff like insert ans before a + is typed.

Lets API consumers override the keyboard events abstraction with a
wrapper around saneKeyboardEvents() that can intercept events and ignore
them or do stuff like insert `ans` before a `+` is typed.
Requested by @mikehaverstock:
#27 (comment)

It really should've in the first place, as the source-of-truth on
keyboard/textare events.

--

Previously listened for `copy` event on textarea for both editable
fields and static math, now only for static math (which doesn't use
`saneKeyboardEvents()`), for editable fields the `cut` and `copy`
handlers are just methods on the controller object.
...like paste and typedText.

Factor out and use checkTextareaOnce().

Note:
- can't just setTimeout() because of the race condition of typing really
  fast after cut/copy (not theoretical: #37)
- can't just checkTextareaFor() or cut/copy handlers would be called
  multiple times (input event, keyup event, timeout etc)

laughinghan@005eca4#commitcomment-17697165
@mikehaverstock
Copy link
Member

@han - image

It looks like this PR broke copy within mathquill. Any ideas?

@mikehaverstock
Copy link
Member

I wouldn't be opposed to moving copy back to where it was to get things working ASAP. That's not an event we need to observe, really.

@laughinghan
Copy link
Collaborator Author

@mikehaverstock: whoops thanks fixed by #35

Sorry I didn't see this, @han doesn't ping me on GitHub, here I'm @laughinghan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants