Note that there are some explanatory texts on larger screens.

plurals
  1. POCapturing the delete/backspace keys in SproutCore
    primarykey
    data
    text
    <p>I have a SproutCore Pane - a PalettePane, specifically - which includes a form tied to an object elsewhere on the screen. The Pane is causing trouble with the object deletion interaction. The way I want it to work is:</p> <ul> <li>If a text input field is in focus, the backspace/delete keys should apply to those fields (i.e. editing the text)</li> <li>If no text input field has focus, the backspace/delete keys should delete the selected object related to the form. (The pane appears when the user has selected an object, so if the pane exists there's a selected object.)</li> </ul> <p>So far, I get one of these behaviors or the other, never both. If I set <code>acceptsKeyPane: YES</code> in the Pane, I get the backspace/delete keys applying to the text fields, but no deleting of selected objects when the text fields don't have focus. If I use <code>acceptsKeyPane: NO</code>, when I'm editing a text field and hit backspace, it deletes the object I was trying to edit.</p> <p>To add insult to injury, in Firefox with <code>acceptsKeyPane: YES</code> the backspace key is caught by the browser and interpreted as a back-button click, which is going to be frustrating to the user.</p> <p>I've looked at the <code>root_responder.js</code> code and it looks like SproutCore handles backspaces differently for Firefox, but if I can handle them as described above the distinction between FF and other browsers should be moot.</p> <p>ETA May 2011: Bear in mind when reading answers here that the SproutCore API for 1.5, 1.6 and beyond may not be the same as this.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload