Skip to content

floating labels shown on textfields with no text #7

@ssavic

Description

@ssavic

If you add a floating label text field to a tableview cell and add about 20 or so of them, so that they are off the screen. when tableview reuses cells, it still shows floating label even for the textfields that have no text.

I've fixed the issue, but i'm having issue make a pull request.
This is where the issue is:

override public func layoutSubviews() {
super.layoutSubviews()
if (isFirstResponder() && !hasText()) {
hideFloatingLabel()
} else if(hasText()) {
showFloatingLabelWithAnimation(true)
}
}

just change it to:

override public func layoutSubviews() {
super.layoutSubviews()
if ((isFirstResponder() && !hasText()) || !hasText()) {
hideFloatingLabel()
} else if(hasText()) {
showFloatingLabelWithAnimation(true)
}
}

Sasa

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