We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Text
KeyMap
Describe the bug WithKeyMap does not seem to have any effect on the Text field.
WithKeyMap
To Reproduce Steps to reproduce the behavior:
textField := huh.NewText(). Title("..."). Value(&message). WithKeyMap(&huh.KeyMap{ Text: huh.TextKeyMap{ Next: key.NewBinding(key.WithKeys("ctrl+enter"), key.WithHelp("ctrl+enter", "next")), Prev: key.NewBinding(key.WithKeys("shift+tab"), key.WithHelp("shift+tab", "back")), NewLine: key.NewBinding(key.WithKeys("enter", "ctrl+j"), key.WithHelp("enter / ctrl+j", "new line")), Editor: key.NewBinding(key.WithKeys("ctrl+e"), key.WithHelp("ctrl+e", "open editor")), }, }) form := huh.NewForm( huh.NewGroup( textField, ), )
Help text at the end of the field does not reflect the new KeyMap and the default keymap still applies.
Expected behavior Next and NewLine should have been overriden.
The text was updated successfully, but these errors were encountered:
Hi! Thanks for the report. For now, you can change the keymap on the form to achieve the same effect:
textField := huh.NewText(). Title("..."). Value(&message) form := huh.NewForm( huh.NewGroup( textField, ), ).WithKeyMap(&huh.KeyMap{ Text: huh.TextKeyMap{ Next: key.NewBinding(key.WithKeys("ctrl+enter"), key.WithHelp("ctrl+enter", "next")), Prev: key.NewBinding(key.WithKeys("shift+tab"), key.WithHelp("shift+tab", "back")), NewLine: key.NewBinding(key.WithKeys("enter", "ctrl+j"), key.WithHelp("enter / ctrl+j", "new line")), Editor: key.NewBinding(key.WithKeys("ctrl+e"), key.WithHelp("ctrl+e", "open editor")), }, })
Sorry, something went wrong.
closing per @meowgorithm response
No branches or pull requests
Describe the bug
WithKeyMap
does not seem to have any effect on theText
field.To Reproduce
Steps to reproduce the behavior:
Help text at the end of the field does not reflect the new KeyMap and the default keymap still applies.
Expected behavior
Next and NewLine should have been overriden.
The text was updated successfully, but these errors were encountered: