Open Bug 256589 Opened 20 years ago Updated 16 years ago

using window.find fails to find multiple matches in textarea

Categories

(SeaMonkey :: UI Design, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

People

(Reporter: smacvicar, Unassigned)

Details

Attachments

(1 file, 1 obsolete file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a3) Gecko/20040822 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a3) Gecko/20040822 The use of window.find fails to find multiple values in a textarea where using Find in page from the Edit menu will. See attached testcase. Push button, the first entry of foo will be highlighted. Pressing multiple times wont match the following entries. Using ctrl+f and searching for foo will find all 3 entries. Reproducible: Always Steps to Reproduce:
Attached file testcase (obsolete) —
Can you make it to work in IE? I have debugged your testcase. What is happening in Mozilla is this: when you click the button, it clears the selection -- this is reminiscent to what happens when you click on the content window, any current selection is cleared on the window. Therefore, the same (first) match is re-found again.
Attachment #156805 - Attachment is obsolete: true
Attached file better testcase
better testcase. the three instances of foo outside the textarea will be found with each button press, it then hits the textarea and finds the first entry. It then doesn't match any of the others after that and goes back to the start. There isn't an IE behaviour since window.find isn't supported.
Is it an important problem for a real application that you have?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Yeah, we have a template editor that allows searching in IE using an IE specific method. bug 241053 fixed searching within textarea using the "Find in Page". I was under the impression that window.find was the same system just with a scripted wrapper.
It is not a simple problem to fix in the back-end. The fact that the focus is switching to the <button> element in the same page confuses the special find-in-textarea. As a work-around in your first example http://bugzilla.mozilla.org/attachment.cgi?id=156805&action=view you can change <button onclick="doFind('foo');">Run Find</button> to <button onclick="document.getElementById('foo').focus();doFind('foo');">Run Find</button>, then position the caret on the first character in the textarea before starting to find.
Product: Core → Mozilla Application Suite
Filter "spam" on "guifeatures-nobody-20080610".
Assignee: guifeatures → nobody
QA Contact: guifeatures
Component: XP Apps: GUI Features → UI Design
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: