<div>
<lightning-input type="datetime" name="input5" label="Start Date:" value={earliestDate} min={minEndDate} max={maxEndDate} onchange={handleDateChange} required></lightning-input>
</div>
<div>
<lightning-input type="text" label="Comments" value={comments} onchange={handleCommentChange}></lightning-input>
</div>
For the comments, I get a very long text field. How can I control the size of the field, can I shorten it? There is nothing in the specification that talks about the width – https://developer.salesforce.com/docs/component-library/bundle/lightning-input/specification
Want the width only as highlighted in the image below:
Any help is appreciated
Best Answer
Ordinarily, you'd use a grid to control the layout:
That said, an overflow of the viewing area suggests that you have a parent element that's too wide; the default size of lightning-input is set to 100% of its parent component. You probably have other CSS or layout issues that will need to be fixed.