Skip to content

Dropdown location bug when text is longer than wrapper #34

Description

@phuwin1995

Hi,

Thank you for an awesome plugin.
I figured a bug in your plugin that the dropdown will stay out of the input field if there is a width limit to the wrapper and the input text is longer than that width limit.
screen shot 2017-01-04 at 11 48 49
I edit the calculateWidthForText() function in your code.
Instead of returning the actual spacer

return spacer.getBoundingClientRect().right; 

the function will return the wrapper width if the spacer right exceeds the width

if (spacer.getBoundingClientRect().right > wrapper.getBoundingClientRect().width)
     return wrapper.getBoundingClientRect().width; 
else 
     return spacer.getBoundingClientRect().right; 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions