Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

156
Views
Disabling text selection popup menu without disabling selection altogether

I'm developing a custom e-reader app. I would like to make a custom highlighting menu, but I'm having trouble disabling the "Copy/Paste/Share" menu that pops up when text is selected on mobile devices. As far as I have researched, it seems impossible to disable without disabling selection altogether. But I wonder if by chance anyone has found a workaround.

I am aware of user-select: none which disables all selection. This is not desirable for me because I will need to access the javascript selection API for saving highlights, among other things.

Thanks!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Doesn't listen for contextmenu event and cancel it - work for you? It works for me on Android phone.

window.addEventListener("contextmenu", e =>
{
  e.preventDefault();
  console.log("selected text:", window.getSelection().toString());
});
some text

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!