Closed Bug 650810 Opened 13 years ago Closed 13 years ago

Last selection range reappears on text inputs that are hidden and subsquently shown using the CSS display property

Categories

(Core :: DOM: Selection, defect)

2.0 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 637671

People

(Reporter: aurami, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16
Build Identifier: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0

I have a text input that receives the focus, has some of its text selected and then loses the focus, which causes the text selection to disappear visually (as it should).

If this input is hidden with "display:none" and subsequently shown with "display:block", it will suddenly show its selection range again, even though it does not currently have the focus.

This becomes even more apparent (and intrusive) if multiple text inputs are affected at the same time.

Reproducible: Always

Steps to Reproduce:
1. Select text in a text input.
2. Give the focus to something else.
3. Hide the text input with "display:none"
4. Show the text input with "display:block"
Actual Results:  
The text input shows its selection range.

Expected Results:  
The text input should not show its selection range if it does not have the focus, which was the behaviour in Firefox 3.6.

I have attached an HTML file that reproduces the problem.
Hmm, this is WFM at least on WinXP using Mozilla/5.0 (Windows NT 5.1; rv:6.0a1) Gecko/20110418 Firefox/6.0a1 ID:20110418030544
WFM in nightly.  Broken in 4.0.  So it was fixed some time within the past month.
Component: Widget: Win32 → Selection
QA Contact: win32 → selection
Version: unspecified → 2.0 Branch
Fixed in this range: http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=6bcaec19d09e&tochange=aa200a803e07

Looking at that pushlog, this is a duplicate of bug 637671.
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: