fix(text_input): clip text in text_input if they exceed initial bounds
This commit is contained in:
parent
78e331d5ed
commit
7d1b557112
1 changed files with 4 additions and 7 deletions
|
|
@ -2204,6 +2204,7 @@ pub fn draw<'a, Message>(
|
|||
} else {
|
||||
appearance.text_color
|
||||
};
|
||||
|
||||
renderer.fill_text(
|
||||
Text {
|
||||
content: if text.is_empty() { placeholder } else { &text },
|
||||
|
|
@ -2221,13 +2222,9 @@ pub fn draw<'a, Message>(
|
|||
);
|
||||
};
|
||||
|
||||
if text_width > text_bounds.width {
|
||||
renderer.with_layer(text_bounds, |renderer| {
|
||||
renderer.with_translation(Vector::new(-offset, 0.0), render);
|
||||
});
|
||||
} else {
|
||||
render(renderer);
|
||||
}
|
||||
renderer.with_layer(text_bounds, |renderer| {
|
||||
renderer.with_translation(Vector::new(-offset, 0.0), render);
|
||||
});
|
||||
|
||||
let trailing_icon_tree = children.get(child_index);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue