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

RESOLVED DUPLICATE of bug 637671

Status

()

Core
Selection
RESOLVED DUPLICATE of bug 637671
7 years ago
7 years ago

People

(Reporter: aurami, Unassigned)

Tracking

2.0 Branch
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

7 years ago
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.
(Reporter)

Comment 1

7 years ago
Created attachment 526738 [details]
A simple HTML file showcasing the spurious selection ranges
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

Comment 3

7 years ago
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
Last Resolved: 7 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 637671
You need to log in before you can comment on or make changes to this bug.