My Request
I need a button that can accommodate both long and short labels, with the text getting cut off at 700px using ellipses. The button should adjust to the available space when the viewport is smaller than 700px. The length of the label can vary greatly, but the button width should always match the content, up to a maximum of 700px.
The Issue I'm Facing
Currently, the button fits the text correctly but maintains a fixed width of 700px even as the viewport size decreases.
Check Out My Demo
https://codesandbox.io/s/mui-testing-forked-opmp8?file=/src/App.js
I am utilizing React and Material-UI for this project, although the problem lies within the styling aspect.
Attempted Solutions
I have experimented with various combinations of max-width
, width
, and min-width
on different containers, yet I have not found a suitable solution thus far.