I'm currently using Material UI chip to show name and email next to each other. However, when the name is long, the email goes beyond the chip boundary.
Here's my function that generates the chips:
getGuestList() {
let {guests} = this.state;
let guestChips = [];
let s = {overflow: 'hidden',width: '50%', display: 'inline-flex'}
guests.map((guest, i) => {
guestChips.push(
<div key={i}>
<Chip
onRequestDelete={() => {this.removeGuest(i)}}
style={{marginTop: 10, width: '225%'}}
labelStyle={{width: '97%'}}
>
<div><div style={s}>
<div style={{textOverflow: 'ellipsis'}}>
{guest.name}
</div>
</div> | <div style={s}>{guest.email ? guest.email : ''}</div></div>
</Chip>
</div>
)
});
Although this method displays both elements on the chip, their widths are limited to 50%. This means that if the email is shorter, there will be empty space next to it, and vice versa for the name.
Is there a solution to handle this issue?