Automatically change the size of textarea (#2128)
This commit is contained in:
		
							parent
							
								
									a8e1afc30a
								
							
						
					
					
						commit
						15a4fc5dcc
					
				
					 2 changed files with 11 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -63,6 +63,10 @@ const AutosuggestTextarea = React.createClass({
 | 
			
		|||
      this.props.onSuggestionsClearRequested();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // auto-resize textarea
 | 
			
		||||
    e.target.style.height = 'auto';
 | 
			
		||||
    e.target.style.height = `${e.target.scrollHeight}px`;
 | 
			
		||||
 | 
			
		||||
    this.props.onChange(e);
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1196,7 +1196,6 @@ a.status__content__spoiler-link {
 | 
			
		|||
  display: block;
 | 
			
		||||
  box-sizing: border-box;
 | 
			
		||||
  width: 100%;
 | 
			
		||||
  resize: none;
 | 
			
		||||
  margin: 0;
 | 
			
		||||
  color: $color1;
 | 
			
		||||
  padding: 10px;
 | 
			
		||||
| 
						 | 
				
			
			@ -1220,11 +1219,17 @@ a.status__content__spoiler-link {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
.autosuggest-textarea__textarea {
 | 
			
		||||
  height: 100px;
 | 
			
		||||
  min-height: 100px;
 | 
			
		||||
  background: $color5;
 | 
			
		||||
  border-radius: 4px 4px 0 0;
 | 
			
		||||
  padding-bottom: 0;
 | 
			
		||||
  padding-right: 10px + 22px;
 | 
			
		||||
  resize: none;
 | 
			
		||||
 | 
			
		||||
  @media screen and (max-width: 600px) {
 | 
			
		||||
    height: 100px !important; // prevent auto-resize textarea
 | 
			
		||||
    resize: vertical;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.autosuggest-textarea__suggestions {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue