Skip to content

Vertical overflow calculation impacting horizontal overflow, vice versa #98

Description

@devendran

We noticed an issue when the vertical overflow calculation impacting horizontal overflow.

The issue is narrowed down to force rounding code below, where in overflowAmount.x check makes overflowAmount.y as zero even in valid cases

var hideOverflowForceRounding = (_viewportElement[0].scrollLeftMax === 0 && overflowAmount.x > 0 && overflowAmount.x < 1) || (_viewportElement[0].scrollTopMax === 0 && overflowAmount.y > 0 && overflowAmount.y < 1);
if (hideOverflowForceTextarea || hideOverflowForceRounding)
	overflowAmount.x = overflowAmount.y = 0;

We have fixed by making 2 different variables each for x and y calculations like below

var hideOverflowForceRoundingX = (_viewportElement[0].scrollLeftMax === 0 && overflowAmount.x > 0 && overflowAmount.x < 1);
var hideOverflowForceRoundingY = (_viewportElement[0].scrollTopMax === 0 && overflowAmount.y > 0 && overflowAmount.y < 1);
                        
if (hideOverflowForceTextarea || hideOverflowForceRoundingX)
	overflowAmount.x =  0;
if (hideOverflowForceTextarea || hideOverflowForceRoundingY)
    overflowAmount.y =  0;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions