Skip to content

Commit

Permalink
Merge pull request #296 from Kamduis/feature-number_input_with_id
Browse files Browse the repository at this point in the history
Added the `id()` method to `NumberInput`
  • Loading branch information
genusistimelord authored Oct 19, 2024
2 parents c0514f8 + cf00f2b commit b37a89d
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 b37a89d

Please sign in to comment.