| Summary: | [editor] editor never propagates a key if a keybinding is registered, even if function returns false | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Susan McCourt <susan> |
| Component: | Client | Assignee: | Felipe Heidrich <eclipse.felipe> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | eclipse.felipe, Silenio_Quarti |
| Version: | 0.2 | ||
| Target Milestone: | 0.2 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
Susan McCourt
Felipe, could you look at this for RC1? If it's too high risk, then I'll need to look at a workaround (I think I know of one)... Yes I can, the code is simple to change. But we need to be careful, if the action handler does not explicitly returns true or false, javascript will put undefined there. Which has the value of false in an if statement. So instead of doing if (!a.userHandler()) maybe is better to use if (a.userHandler() === false) to make sure the action propagation only proceeds when the user handler explicitly returns false. Silenio: As for invokeAction, I don't think it will change. cause the doc says it returns true when a handler is called (which means to me that is doesn't matter what the handler returns, as long the name has handler the invokeAction returns true... fixed http://git.eclipse.org/c/e4/org.eclipse.orion.client.git/commit/?id=92590403058b6f1cfbf0c432674fa3b56fe9821e the doc in setAction() says: " If the given handler returns <code>true</code>, the default action handler is not called." so, the handler has to explicitly return true to stop the action, not returning or returning false will allow the text view handler (or user-agent default handle) to run. |