Description
Pasted text in the search field requires workaround steps. When pasting in the search form, the buttons remain greyed out as though no text was typed.
By default, the «return» key searches for title matches. Upon completion of that search, the styled text is erased and the Text button is enabled. This is inefficient since casual users are confused about the grey buttons, which results in duplicate searches and excessive server load.
Browsers affected so far are Safari, iCab and Omniweb, and Firefox, but as more browsers use Apple's built-in Webkit, the problem may become more severe.
Steps to reproduce
- On a participating computer, using a text editor, copy the text.
- Paste the text in the Search form in the Moin page.
- The buttons remain grey. Add a space and the buttons are now clickable.
Component selection
Don't know.
Details
This Wiki.
Workaround
Adding one space character (as a minimum action) causes the text to be recognized and suddenly the buttons are clickable.
Discussion
This also happens with copy and paste on linux/firefox. Same workaround works, too.
Here some first test results with a small testprogramm test.html
Mac OS X 10.5.1 (Leopard), Safari 3.0.4: Pasting something from the clipboard (styled or unstyled text) into the search field does not trigger any javascript event at all! Neither onkeyup, onchange, onclick, onfocus. The button therefore remain grayed out. This is also true when pasting something via drap&drop into the searchfield (see http://bugs.webkit.org/show_bug.cgi?id=9553). Hitting the return key triggers then an onchange event. Hitting some other key instead (as proposed by the workaround) triggers an onkeyup event.
IE7, WinXp Home Sp2: Pasting something from the clipboard into the searchfield does trigger an onkeyup event. Search form behaves correct therefore.
Firefox 2.0.0.11, WinXp Home Sp2: Pasting triggers first an onkeyup then an onchange event. Search form behaves correct. (Maybe the onchange is caused by the alert box which pops up?)
Opera 9.24, WinXp Home Sp2: Pasting triggers first an onkeyup then an onchange event. Search form behaves correct. (Maybe the onchange is caused by the alert box which pops up?)
-- OliverSiemoneit 2008-01-05 17:08:31
Some reserch into onpaste event:
Mac OS X 10.5.1 (Leopard), Safari 3.0.4: onpaste event triggered when pasting something into the searchfield via cmd-v or the menu bar ("Edit -> Paste"). Drag&Drop does not trigger a paste event.
IE7, WinXp Home Sp2: Pasting something from the clipboard into the searchfield via keyboard or the menu does trigger an onpaste event.
Firefox 2.0.0.11, WinXp Home Sp2: No paste event triggered. Not supported? Pasting via the menu does not trigger any event. Pasting in this way is thus unrecognizable.
Opera 9.24, WinXp Home Sp2: No paste event triggered. Not supported? Pasting via the menu does not trigger any event. Pasting in this way is thus unrecognizable.
Therefore: Adding onpaste="searchChange(this)"to the input field should fix the Safari behaviour. -- OliverSiemoneit 2008-01-05 18:35:19
For me on a linux box copying in firefox 2.0.0.11 by strg+c and srtg+v works of any kind of text. It does not work to insert text only using the middle mouse button.
Some research into oninput event:
Safari: Typing something into the searchfield, pasting something into it via the menu, drag&drop or cmd-v triggers always an oninput event!
- IE7: No oninput event available. Not supported?
- Firefox: Typing something into the searchfield, pasting something into it via the menu, ctrl-v triggers always an oninput event.
- Opera: Typing something into the searchfield, pasting something into it via the menu, ctrl-v triggers always an oninput event.
It seems like this: Adding oninput="searchChange(this)"to the input field should be the correct replacment for the onkeyup event. However IE does not support oninput. IE needs onkeyup (to recognize if you type something in, paste something in via ctrl-v) and onpaste (for paste via the menu bar).
-- OliverSiemoneit 2008-01-05 22:15:27
Plan
- Priority:
- Assigned to:
- Status: