Skip to content

api.Document.getSelection - not fully supported on Firefox #21697

@davidrans

Description

@davidrans

What type of issue is this?

Browser bug (a bug with a feature that may impact site compatibility)

What information was incorrect, unhelpful, or incomplete?

The article contains this (correct) info about Firefox compatibility:

It is worth noting that currently getSelection() doesn't work on the content of elements in Firefox. HTMLInputElement.setSelectionRange()) could be used to work around this.

However

What browsers does this problem apply to, if applicable?

Firefox

What did you expect to see?

Firefox compatibility issues should be noted in the browser compatibility section.

Did you test this? If so, how?

document.getSelection().toString() returns an empty string on input/textarea fields in my testing on Firefox 120.0.1

Can you link to any release notes, bugs, pull requests, or MDN pages related to this?

https://bugzilla.mozilla.org/show_bug.cgi?id=85686

Do you have anything more you want to share?

No response

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/Document/getSelection

MDN metadata

MDN page report details
  • Query: api.Document.getSelection
  • Report started: 2023-12-20T18:07:37.624Z

Metadata

Metadata

Assignees

Labels

data:apiCompat data for Web APIs. https://developer.mozilla.org/docs/Web/API

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions