Skip to content

Commit

Permalink
[Chips] In MDCChipField, account for horizontal padding when calculat…
Browse files Browse the repository at this point in the history
…ing available width for text field (#9841)

This change addresses an issue introduced in #9837, where the calculation of available width for the text field did not take into account the chip field's horizontal insets.
  • Loading branch information
bryanoltman committed Mar 5, 2020
1 parent 2ca4e3e commit 2ceeb0a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion components/Chips/src/MDCChipField.m
Expand Up @@ -734,7 +734,7 @@ - (CGFloat)availableWidthForTextInput {
}

CGRect lastChipFrame = [chipFrames.lastObject CGRectValue];
return boundsWidth - CGRectGetMaxX(lastChipFrame);
return boundsWidth - CGRectGetMaxX(lastChipFrame) - self.contentEdgeInsets.right;
}

// The width of the text input + the clear button.
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2ceeb0a

Please sign in to comment.