Skip to content

Commit

Permalink
Autofill: Fix footer sizing for multiline labels (#2422)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/1201462886803403/1206371260426517/f
Tech Design URL:
CC:

Description:
This is a fix for the autofill tableview footer label not sizing correctly when there is more than one line of text
  • Loading branch information
amddg44 authored Feb 5, 2024
1 parent b28a385 commit e06582a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion DuckDuckGo/AutofillSettingsEnableFooterView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,14 @@ class AutofillSettingsEnableFooterView: UIView {

private func installConstraints() {
title.translatesAutoresizingMaskIntoConstraints = false

let bottomConstraint = title.bottomAnchor.constraint(equalTo: self.bottomAnchor, constant: -Constants.defaultPadding)
// setting priority to ensure multiline text is displayed correctly
bottomConstraint.priority = .defaultHigh

NSLayoutConstraint.activate([
title.topAnchor.constraint(equalTo: self.topAnchor, constant: Constants.topPadding),
title.bottomAnchor.constraint(equalTo: self.bottomAnchor, constant: -Constants.defaultPadding),
bottomConstraint,
title.leadingAnchor.constraint(equalTo: self.leadingAnchor, constant: Constants.defaultPadding),
title.trailingAnchor.constraint(lessThanOrEqualTo: self.trailingAnchor, constant: -Constants.defaultPadding)
])
Expand Down

0 comments on commit e06582a

Please sign in to comment.