Open
Bug 343143
Opened 18 years ago
Updated 2 years ago
wrong value of input.scrollWidth
Categories
(Core :: DOM: CSS Object Model, defect, P5)
Core
DOM: CSS Object Model
Tracking
()
NEW
People
(Reporter: zdila, Unassigned)
References
(Depends on 1 open bug)
Details
(Whiteboard: [cssom-view])
Attachments
(1 file)
455 bytes,
text/html
|
Details |
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.5; Linux 2.6.15; X11) KHTML/3.5.2 (like Gecko) (Debian package 4:3.5.2-2+b1)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4
HTML:
<input id="inp" type="text" value="some a bit longer text to demonstrate the bug" />
ECMAScript:
document.getElementById("inp").scrollWidth
Problem description:
scrollWidth doesn't return width of the text inside input. It returs the same value as offsetWidth even if text doesnt fit the space of input field.
In MS Internet Explorer it works correctly.
BTW, isn't that the same as bug 209807?
Reproducible: Always
Actual Results:
scrollWidth ignores width of the input's content
Expected Results:
scrollWidth shold be equal to input's content width
Updated•18 years ago
|
Assignee: nobody → general
Component: General → DOM: Mozilla Extensions
Product: Firefox → Core
QA Contact: general → ian
Version: unspecified → Trunk
Comment 1•18 years ago
|
||
scrollWidth would only apply to a scrollable object, and the text input itself is not scrollable...
We could try to hack something together here for IE compat, but I'm not sure it's worth it.
Martin: How is this value useful? I.e. what would you use the value for if it was available?
Boris: Is there some other way for the user to get this value?
Comment 4•18 years ago
|
||
Not really, no.
Reporter | ||
Comment 5•17 years ago
|
||
I needed this to resize width of the input field to the size of this content with JS.
Comment 6•17 years ago
|
||
Confirming, but maybe we want a different API here for getting that information...
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•15 years ago
|
Assignee: general → nobody
QA Contact: ian → general
Comment 7•15 years ago
|
||
I'm having same problem with scrollWidth in FireFox (3.5.7), while in IE7 this works fine - returns scrollWidth values correctly.
Comment 9•14 years ago
|
||
Bug 536706 comment 0 might provide useful information on why this happens and how to fix it.
Updated•13 years ago
|
Component: DOM: Mozilla Extensions → DOM: CSS Object Model
QA Contact: general → style-system
Whiteboard: [cssom-view]
Comment 10•6 years ago
|
||
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046
Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.
If you have questions, please contact :mdaly.
Priority: -- → P5
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•