cloneNode(textarea) will set defaultValue as value.

RESOLVED DUPLICATE of bug 230307

Status

()

RESOLVED DUPLICATE of bug 230307
14 years ago
10 years ago

People

(Reporter: brunoabdon+moziilabugzilla, Unassigned)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

14 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4

When a textarea is cloned with cloneNode, the clone will have it's 'value'
attribute set to the 'defaultValue' from the original.

That is, if you do:

var textarea2 = textearea1.cloneNode(true);

the textarea2.value will be equals to textearea1.defaultValue


If this is expected behaviour (and I believe it isn't), so there's a bug on
<input>s behaviour, as cloned inputs maintain the original value.



Reproducible: Always

Steps to Reproduce:
1.Change a textarea's value (contents)
2.Clone this textarea
3.Check the cloned textarea's value

Actual Results:  
The clone textarea's value is the original textarea's defaultValue (value prior
to change)

Expected Results:  
The clone textarea's value should be the original textarea's value at cloning time.

I'll be attaching a simple test case.

Cloned inputs won't behave this way.
(Reporter)

Comment 1

14 years ago
Created attachment 189339 [details]
Simple testcase

Adding a simple testecase with included instructions.

Comment 2

14 years ago
Looks like a dupe of bug 230307 to me.
(Reporter)

Comment 3

14 years ago
Surely a dup. I'm moving my testcase there. (They alredy have one, but its too
complicated (IMHO)).

*** This bug has been marked as a duplicate of 230307 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → DUPLICATE

Updated

10 years ago
Component: DOM: Core → DOM: Core & HTML
QA Contact: ian → general
You need to log in before you can comment on or make changes to this bug.