Skip to content

Commit

Permalink
Added the id() method to NumberInput
Browse files Browse the repository at this point in the history
This enables users to set the ID of the underlying `TextInput`.
  • Loading branch information
Kamduis committed Oct 15, 2024
1 parent c0514f8 commit cf00f2b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/widget/number_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,13 @@ where
self.class = class.into();
self
}

/// Sets the [`Id`] of the underlying [`TextInput`].
#[must_use]
pub fn id(mut self, id: impl Into<text_input::Id>) -> Self {
self.content = self.content.id( id.into() );
self
}
}

impl<'a, T, Message, Theme, Renderer> Widget<Message, Theme, Renderer>
Expand Down

0 comments on commit cf00f2b

Please sign in to comment.