You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried using the <layout> component from blessed which, although experimental, was a method I found to get inputs that shrink to their content's height rather than setting a percentage height on them.
I notice that the blessed readme calls the layout component experimental, but thought I'd offer a bug report anyway to see where it goes.
Using layout and setState causes the screen to go blank. See below for boilerplate to recreate the problem, with a tree that works next to it.
importReact,{Component}from'react';importblessedfrom'blessed';import{render}from'react-blessed';import{exec}from'child_process';classAppextendsComponent{constructor(props){super(props);this.state={searchFor: '',results: 'hiiiiiiiiiiiiiiiiiii'};}componentDidMount(){setTimeout(()=>{this.setState(()=>{return{results: 'hi'}});},1000);}render(){// this will make everything disappear after setState()return(<form><layoutwidth="100%"height="shrink"><boxheight="shrink"width="100%"border={{type: 'line'}}>hi</box><boxheight="shrink"width="100%"border={{type: 'line'}}>{this.state.results}</box></layout></form>);// this worksreturn(<form><boxheight="50%">hi</box><boxheight="50%"width="100%"top="50%">{this.state.results}</box></form>);}}constscreen=blessed.screen({autoPadding: true,smartCSR: true,title: 'react-blessed box animation'});screen.key(['escape','q','C-c'],function(ch,key){returnprocess.exit(0);});render(<App/>,screen);
The text was updated successfully, but these errors were encountered:
Thanks for this awesome library 😄
I tried using the
<layout>
component from blessed which, although experimental, was a method I found to get inputs that shrink to their content's height rather than setting a percentage height on them.I notice that the blessed readme calls the layout component experimental, but thought I'd offer a bug report anyway to see where it goes.
Using layout and setState causes the screen to go blank. See below for boilerplate to recreate the problem, with a tree that works next to it.
The text was updated successfully, but these errors were encountered: