Skip to content

Setting Botton/Top offset affects width #343

@Ameya-Garg

Description

@Ameya-Garg

When I change the offset of the dropDown to be be more to the left, it will only move to a certain point, after a certain threshold the dropdown will not move more left, but it will become wider with the right side of the dropdown being unaffected while the left side goes further away.

` let dropDown = DropDown()
dropDown.anchorView = sender

    dropDown.topOffset = CGPoint(
        x: -(dropDown.anchorView?.plainView.bounds.width)!/3,
        y: -(dropDown.anchorView?.plainView.bounds.height)!/3
    )
    dropDown.bottomOffset = CGPoint(
        x: -(dropDown.anchorView?.plainView.bounds.width)!/3,
        y: (dropDown.anchorView?.plainView.bounds.height)!/3
    )

    dropDown.cornerRadius = kCornerRadius

    dropDown.dataSource = [
        "option1",
        "option2",
        "option3",
    ]
    dropDown.selectionAction = handleDropDownSelection
    dropDown.dismissMode = .automatic
    dropDown.show()`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions