Closed Bug 1012202 Opened 10 years ago Closed 7 years ago

eBay Messages: textarea is expanded while typing due to the scrollHeight change with Firefox 29


(Web Compatibility :: Site Reports, defect)

Not set


(platform-rel ?)

Tracking Status
platform-rel --- ?


(Reporter: kohei, Unassigned)




(Keywords: dev-doc-complete, regression, site-compat, Whiteboard: [country-all] [js] [platform-rel-eBay][sitewait])


(1 file)

Users are reporting a typing issue on eBay Messages starting with Firefox 29. Seems like the same issue is happening on IE 10. Anyone has an eBay account for test?
I have created another account to compose a message. It's a side effect of Bug 157846.
Assignee: nobody → english-us
Blocks: 157846
Component: Event Handling → English US
Product: Core → Tech Evangelism
Summary: eBay Messages typing issue on Firefox 29+ → eBay Messages: textarea is expanded while typing due to the scrollHeight change with Firefox 29
Version: 29 Branch → Trunk
Attached file testcase
A *quick* solution here is:

1) Change the padding to 5px 
2) Change the condition to

> if (navigator.userAgent.match(/Firefox\/(\d+)/i) && parseInt(RegExp.$1) < 29)

> if (navigator.userAgent.match(/Firefox\/(\d+)/i) && parseInt(RegExp.$1) < 29)

Which script are you talking about? :)
Which sites are we talking about? URL field in the bug report.
Flags: needinfo?(kohei.yoshino)
Looks like the script is embedded in HTML that requires sign-in. Here's a code snippet.

_d.add('message_cnt','keyup',function(event) { this.increaseSize("message_cnt"); },;

increaseSize:function(eleId){var ele=this.vj$.E.get(eleId);var sheight=ele.scrollHeight;if(sheight>45){if(navigator.userAgent.toLowerCase().indexOf('firefox')>-1){"px";}else{"px";}}}
Flags: needinfo?(kohei.yoshino)
I had the same issue with Firefox 29, and our autoexpanding textarea code.  Starting with Firefox 29 every character entered into a textarea with css "overflow: hidden", will increase the textarea.scrollHeight but 5px.   I found a workaround by setting "overflow: scroll" prior to asking for scrollHeight.  Here is our code:

Common.autoexpandingtextarea = function(element, params) {
	var self = this;
	var jQueryElement = j(element);
	if (jQueryElement.length == 0) { return false; }

	var options = j.extend({
		minHeight: jQueryElement.height(),
		maxHeight: 155,
		onUpdate: null
	}, params);
	this.init = function() {
		jQueryElement.height(options.minHeight).on("keyup", self.updated);
	this.updated = function() {
		// Starting in Firefox 29 in order to get acrurate scrollHeight overflow = scroll
		jQueryElement.css("overflow", "scroll");
		var scrollHeight = jQueryElement.get(0).scrollHeight;

		var newHeight = Math.max(options.minHeight, Math.min(scrollHeight, options.maxHeight));
		jQueryElement.height(newHeight).css("overflow", (scrollHeight > newHeight) ? "auto" : "hidden");
		if(options.onUpdate) { options.onUpdate(); }
Moving to desktop component.
We have contacts with eBay. We might be able to get help from them.
Desigan, could you help find the right person for this one?

Assignee: english-us → nobody
Component: English US → Desktop
Flags: needinfo?(dchinniah)
Whiteboard: [country-all] [js]
More than happy to put this on the radar off my contacts. 

However rather than just pointing to the bug could someone provide me some context via email — and I'll then add Jonny to the thread and point him to the bug as well. He'll then provide us direct contact to the team that works on the eNay Messages/Inbox component.
Flags: needinfo?(dchinniah)
What I sent to Desigan and Jonathan.

Desigan, Jonathan,

About the bug

On Ebay messages [1], an issue started with version 29 of Firefox and version 10 of IE. When someone is typing a message, the textarea expands little by little. It's a side effect of fixing the bug 157846 [2] " Incorrect implementation of padding on textarea elements (scrollbars/resizer wrongly positioned)". A human friendly explanation of the textarea bug has been given in Firefox Site Compatibility fixes [3].

A suggested fix for Ebay has been proposed in #Comment 7 of the bug. Feel free to use it. If you do something else, it would be cool if you could share in the bug itself what was the solution found by your team. I'm pretty sure it could help others. 

Thanks a lot.

Flags: needinfo?(j)
Flags: needinfo?(dchinniah)
Jonny has passed this onto the appropriate team internally. Hopefully they will make an appearance on this bug.
Flags: needinfo?(dchinniah)
platform-rel: --- → ?
Whiteboard: [country-all] [js] → [country-all] [js] [platform-rel-eBay]
Kohei, would you be able to test if this still reproduces? Thanks!
Flags: needinfo?(kohei.yoshino)
Whiteboard: [country-all] [js] [platform-rel-eBay] → [country-all] [js] [platform-rel-eBay][sitewait]
ni? to try to repro myself.
Flags: needinfo?(kohei.yoshino) → needinfo?(miket)
This doesn't reproduce for me anymore. Let's close.
Closed: 7 years ago
Flags: needinfo?(miket)
Resolution: --- → WORKSFORME
Flags: needinfo?(j)
Product: Tech Evangelism → Web Compatibility
You need to log in before you can comment on or make changes to this bug.