Skip to main content

ComposerInput

Function ComposerInput 

Source
pub fn ComposerInput(props: ComposerInputProps) -> impl IntoView
Expand description

输入栏里的输入框:单行 input 或多行 textarea(field-sizing: content), 自带输入法守卫。

Props:

  • value / oninput:受控值
  • placeholder、id、aria_label、maxlength、autofocus、disabled
  • multiline:多行 textarea;否则单行 input
  • search:单行搜索框,type=search、name=q、enterkeyhint=search (无脚本时随表单 GET 提交)
  • on_submit:多行时 ⌘/Ctrl+Enter 调用;单行时给了就由 Enter 调用并阻止默认, 否则交给所在表单原生提交
  • onkeydown:调用方的其余按键(Escape、↓ 等);输入法组合期间不转发
  • oncomposition:组合输入开始(true)/ 结束(false)
  • input_ref / textarea_ref:单行 input / 多行 textarea 的 NodeRef,供调用方聚焦

§Required Props

§Optional Props