Q.Prompt - any way to control action of 'return' button

0 views
Skip to first unread message

matt vella

unread,
Sep 1, 2010, 4:36:09 PM9/1/10
to Qutensil
Right now, it seems that pressing the 'return' button automatically
triggers a confirm action within a Q.Prompt window. I am wondering if
this can be controlled somehow. In my case, I'd actually want a
'return' to simply insert a carriage return into the the textarea, so
that users can more fully add and edit text here.

Thanks!
Matt

matt vella

unread,
Sep 2, 2010, 10:29:06 AM9/2/10
to Qutensil
OK, I see in the code where this is - it seems to be hardcoded. Would
you consider making this an option for the next release? That is; add
an option to turn off the 'return' button's behavior of triggering a
'confirm'.

Thanks,
Matt

wonderingwout

unread,
Sep 2, 2010, 10:36:46 AM9/2/10
to Qutensil
Hi Matt,

There is already a fix in the next release.
When focussed on the textarea the enter button responds to the
textarea rather than the enter button.

Wout

Thomas

unread,
Sep 3, 2010, 5:20:02 AM9/3/10
to Qutensil
As a quickfix, you can do this to q.window.js (line 338):

// watch the enter button (as long as there's no textarea, - Thomas)
this.confirmWithEnter = (function(event) {
if (event.keyCode == 13 && typeof(this.textarea) == 'undefined')
{
next.focus();
onConfirm();
}
}).bind(this);
Reply all
Reply to author
Forward
0 new messages