Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
Index: www/extras/yui-webgui/build/form/datatable.js =================================================================== --- www/extras/yui-webgui/build/form/datatable.js (revision 11042) +++ www/extras/yui-webgui/build/form/datatable.js (working copy) @@ -132,8 +132,10 @@ */ this.handleEditorShowEvent = function ( obj ) { - obj.editor.focus(); - setTimeout( obj.editor.focus, 500 ); + /* If we set the focus now, something might (and sometimes does) set + * it later in the event handling chain. Let's defer the focus set + * until this chain is finished. */ + setTimeout(function() { obj.editor.focus() }, 0); }; /************************************************************************ @@ -144,7 +146,6 @@ = function () { var row = this.dataTable.getLastTrEl(); this.dataTable.showCellEditor( row.firstChild ); - this.dataTable.getCellEditor().focus(); }; /************************************************************************
This paste will be private.
From the Design Piracy series on my blog: