luddep / LPKit

A collection of re-usable views, controls & utilities for Cappuccino.
http://observerapp.com
MIT License
166 stars 31 forks source link

LPMultiLineTextField consumes all key events #19

Open BlairDuncan opened 14 years ago

BlairDuncan commented 14 years ago

Once a LPMultiLineTextField is activated, it continues to consume all key events even when not active.

From what I understand, the method "performKeyEquivalent" should by default return NO and only YES if the key was acted on.

Actually I'm not even sure if it needs to be there at all, I don't notice any difference with it completely removed.

luddep commented 14 years ago

So, I believe this is there to not swallow events such as cmd+c.

This seems like a bug where it just doesn't resign first responder appropriately, and should be fixed elsewhere.

appden commented 14 years ago

Cappuccino will do the right thing, it took me an hour to figure out that LPMultiLineTextField was passing all events along to the browser. It's mere presence on the page royally screws key events everywhere with this method. This method is meant for assigning keyboard shortcuts to things like buttons.

luddep commented 14 years ago

I can't reproduce those problems, but if anyone produces a fix I'll merge them in right away.

appden commented 14 years ago

If you have undo/redo in your menubar, the keyboard shortcuts will not work when LPMultiLineTextField (MLTF) is on the page because implementing performKeyEquivalent on MLTF and always returning YES is effectively saying that it will always handle any keyboard shortcuts on the page.

The fix is simply removing that method. :)

eventualbuddha commented 14 years ago

I'm having the same issue. I put together a really simple app demonstrating the issue. I confirmed that removing performKeyEquivalent: fixes the issue.

http://dl.dropbox.com/u/40652/LPMultilineTextField-tabbing-problem/index.html

eventualbuddha commented 14 years ago

Here's my pull request that fixes it: https://github.com/luddep/LPKit/pull/35