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
When rendering a new TextInput after getting another input from another TextInput the second input does not wait and the app will exit.
TextInput
e.g.
import React from "react"; import { Box } from "ink/build"; import TextInput from "ink-text-input"; const Input1 = ({ value, onChange }) => ( <Box> Input 1: <TextInput value={value ?? ""} onChange={onChange} /> </Box> ); const Input2 = ({ value, onChange }) => ( <Box> Input 2: <TextInput value={value ?? ""} onChange={onChange} /> </Box> ); export default class App extends React.Component { constructor(props) { super(props); this.state = { input1: undefined, input2: undefined }; this.onFirstInput = this.onFirstInput.bind(this); this.onSecondInput = this.onSecondInput.bind(this); } render() { return !this.state.input1 ? ( <Input1 onChange={this.onFirstInput} /> ) : ( <Input2 onChange={this.onSecondInput} /> ); } onFirstInput(input1) { this.setState({ input1 }); } onSecondInput(input2) { this.setState({ input2 }); } }
This will render Input 1: and wait for input. After pressing a key it will render Input 2: and then exit.
Input 1:
Input 2:
The text was updated successfully, but these errors were encountered:
I faced same issue. Not only that, I cannot also submit the form. Need to see if this is a ink 2 spectific problem.
ink 2
Sorry, something went wrong.
Found it, fix coming up soon! Thanks for reporting ;)
Update to Ink 2.0.1 and it should be fixed. Let me know if it doesn't and I will re-open the issue.
No branches or pull requests
When rendering a new
TextInput
after getting another input from anotherTextInput
the second input does not wait and the app will exit.e.g.
This will render
Input 1:
and wait for input. After pressing a key it will renderInput 2:
and then exit.The text was updated successfully, but these errors were encountered: