chjj / blessed

A high-level terminal interface library for node.js.
Other
11.32k stars 534 forks source link

Unable to re-edit textboxes in insert mode #33

Open jamesdabbs opened 10 years ago

jamesdabbs commented 10 years ago

Textboxes appear to be write-once, which makes it hard to correct typos. To reproduce, start with the inclueded simple-form example and add:

blessed.textbox({
  parent: form,
  keys: true,
  left: 2,
  top: 1,
  width: 15,
  height: 1,
  style: {
    bg: "blue",
    focus: {
      bg: "red"
    }
  }
});

Then press down, enter, type some text, and press enter. At this point neither i nor enter seem to switch to insert mode, though e to edit still works (and leaves me in insert mode in the field after exiting from my editor). Am I misunderstanding the intended behavior?

chjj commented 10 years ago

Try using some of the widget tests as a base: https://github.com/chjj/blessed/blob/master/test/widget-textarea.js

I'm not sure what the exact problem you're describing is, but that textarea example might get you off to a good start. Let me know how it goes.

zarkone commented 10 years ago

:+1: It's all ok with textarea, but not with textbox. it looks like Textbox doesn't take input.