Closed Bug 1813458 Opened 2 years ago Closed 5 months ago

Pressing Backspace when typing a reply on steamcommunity.com forums causes page to scroll up

Categories

(Core :: Layout: Scrolling and Overflow, defect, P3)

Firefox 109
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: choinnn1, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:109.0) Gecko/20100101 Firefox/109.0

Steps to reproduce:

  • Be logged in on steamcommunity.com.
  • Open any forum thread with enough replies where you can type your own reply.
  • Start typing. Try removing what you typed with Backspace.

Actual results:

Page scrolling up when pressing Backspace to remove typed text.

Expected results:

Page should not scroll on pressing Backspace.

The Bugbug bot thinks this bug should belong to the 'Core::Panning and Zooming' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Panning and Zooming
Product: Firefox → Core

Sounds similar to bug 1768330.

See Also: → 1768330

This may be somewhat related to bug 1674687 and bug 1774315.

There's a keyup event handler doing;

OnTextInput: function()
	{
		var iScrollOffset = undefined;
		var cNewLength = this.m_elTextArea.value.length;

		// we delay this until first input as some values get reported incorrectly if the element isn't visible.
		if ( this.m_nTextAreaPadding === null && $J(this.m_elTextArea ).is(':visible') )
			this.CalculatePadding();

		// force a resize
		if ( cNewLength < this.m_cEntryLength )
		{
			// when we shrink this box, we might scroll the window.  Remember where we are so we can jump back
			iScrollOffset = window.scrollY;
			this.m_elTextArea.style.height = this.m_nMinHeight + 'px';
		}

		if ( this.m_elTextArea.scrollHeight > this.m_nMaxHeight )
		{
			this.m_elTextArea.style.height = this.m_nMaxHeight + 'px';
			this.m_elTextArea.style.overflow = 'auto';
		}
		else if ( this.m_elTextArea.scrollHeight != this.m_elTextArea.getHeight() )
		{
			var nHeight = Math.max( this.m_elTextArea.scrollHeight, this.m_nMinHeight );
			this.m_elTextArea.style.height = ( nHeight - this.m_nTextAreaPadding ) + 'px';

			if ( this.m_elTextArea.style.overflow == 'auto' )
				this.m_elTextArea.style.overflow = 'hidden';
		}

		if ( this.m_fnChangeCallback )
			this.m_fnChangeCallback( this.m_elTextArea );

		if ( iScrollOffset )
			window.scrollTo( window.scrollX, iScrollOffset );

		this.m_cEntryLength = cNewLength;
	}

So it does basically window.scrollTo(window.scrollX, window.scrollY)

Status: UNCONFIRMED → NEW
Component: Panning and Zooming → Layout: Scrolling and Overflow
Ever confirmed: true

Setting as S2/P2 based on the similar bug 1768330

Severity: -- → S2
Priority: -- → P2
Whiteboard: [apz-needsdiagnosis]

Emilio thinks this might be a version of (or helped by) bug 1674687.

Depends on: 1674687
Whiteboard: [apz-needsdiagnosis]

Downgrading P3:S3 since the issue is different from bug 1768330. Bug 1768330 caused jumpy scrolling, rather this bug causes just 1px jittering.

Severity: S2 → S3
Priority: P2 → P3
Flags: needinfo?(michaelbhavel)

I can't reproduce this issue on the latest nightly. I am not sure whether the site has changed or not, though.

choinn, feel free to reopen this bug if you can still see this bug on nightlies which have the change for bug 1674687. Thanks.

Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.