How to disable the mobile Safari selection menu?

I’m implementing a Medium style selection menu based on the selectionSizePlugin example and it works perfectly in desktop Chrome and iOS Safari.

My issue is the menu that pops up in mobile Safari when selecting text. I found the CSS style -webkit-touch-callout: none, but this only works for the long-press menu on links, not text selections. I also found an SO question that suggests removing the text selection and adding back with JavaScript. That seems sub-optimal to say the least.

I was curious if others has encountered this issue and how you addressed it. Thanks.

I’d be very happy if someone finds a way to do this, but last time I looked into it (which was a few years ago) my conclusion was that there isn’t any workable way to do so.

I did more research on this and it appears to be part of iOS itself, not Safari like I originally stated. The same menu appears when you select text in other applications.