Skip to content

Commit

Permalink
Textarea fields in Datapoine Editor should have at least one line, ev…
Browse files Browse the repository at this point in the history
…en if empty.

PiperOrigin-RevId: 555455444
  • Loading branch information
iftenney authored and LIT team committed Aug 10, 2023
1 parent 8fa1ce5 commit c9fa823
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lit_nlp/client/modules/datapoint_editor_module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export class DatapointEditorModule extends LitModule {
convertToString: boolean = true) {
const characterWidth = 8.3; // estimate for character width in pixels
const numLines = Math.ceil(characterWidth * textLength / clientWidth);
const height = this.convertNumLinesToHeight(numLines);
const height = this.convertNumLinesToHeight(Math.max(1, numLines));
return convertToString ? `${height}ex` : height;
}

Expand Down

0 comments on commit c9fa823

Please sign in to comment.