Here is a simplified code snippet to illustrate the issue:
HTML
<div class="container">
<button class="no-select">Button</button>
Container Text
</div>
CSS
.no-select {
user-select: none; /* Pretend this works for all browsers */
}
When interacting with the button on desktop, the text inside the button is not highlighted as expected.
However, when long-pressing the button on mobile devices, instead of selecting the button's text, it starts selecting the parent element's text. This can be observed by testing on iOS. Can someone verify if this behavior occurs on other devices?
This issue can also be seen on Material-UI's buttons. Long-pressing a button on an iOS device will exhibit the same bug.
How can we prevent this unintended behavior from happening?