Skip to main content

kozan_core/html/
html_textarea_element.rs

1//! `HTMLTextAreaElement` — a multi-line text editing control.
2//!
3//! Chrome equivalent: `HTMLTextAreaElement`.
4
5use super::form_control::{FormControlElement, TextControlElement};
6use crate::Handle;
7use kozan_macros::{Element, Props};
8
9/// A multi-line text editing control (`<textarea>`).
10///
11/// Chrome equivalent: `HTMLTextAreaElement`.
12#[derive(Copy, Clone, Element)]
13#[element(tag = "textarea", focusable, data = TextAreaData)]
14pub struct HtmlTextAreaElement(Handle);
15
16/// Element-specific data for `<textarea>`.
17#[derive(Default, Clone, Props)]
18#[props(element = HtmlTextAreaElement)]
19#[non_exhaustive]
20pub struct TextAreaData {
21    /// The visible width in average character widths.
22    #[prop]
23    pub cols: u32,
24    /// The visible number of text lines.
25    #[prop]
26    pub rows: u32,
27    /// How the text wraps: "soft" (default) or "hard".
28    #[prop]
29    pub wrap: String,
30}
31
32impl FormControlElement for HtmlTextAreaElement {}
33impl TextControlElement for HtmlTextAreaElement {}