You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The changes from Pull Request #5954 to $insertDataTransferForRichText now result in the selection parameter not being utilized for 'text/plain' dataTranfers.
Lexical version: 0.16.0
Steps To Reproduce
Call $insertDataTransferForRichText(dataTransfer, selection, editor) where the dataTransfer is of type 'text/plain' and selection is some RangeSelection but not the current selection, i.e. not selection !== $getSelection()
The current behavior
$insertDataTransferForRichText inserts text from the dataTransfer parameter to the current selection ($getSelection())
The expected behavior
$insertDataTransferForRichText should insert text from the dataTransfer parameter to the selection parameter as per the function description
/**
* @param dataTransfer an object conforming to the [DataTransfer interface] (https://html.spec.whatwg.org/multipage/dnd.html#the-datatransfer-interface)
* @param selection the selection to use as the insertion point for the content in the DataTransfer object
* @param editor the LexicalEditor the content is being inserted into.
*/
For context, I was using this function for a "replace all" function for a find and replace tool. Naturally I don't want to set the current selection to each selection to be replaced; I just want to iteratively create range selections to replace with rich text.
The text was updated successfully, but these errors were encountered:
The changes from Pull Request #5954 to
$insertDataTransferForRichText
now result in theselection
parameter not being utilized for 'text/plain' dataTranfers.Lexical version: 0.16.0
Steps To Reproduce
$insertDataTransferForRichText(dataTransfer, selection, editor)
where thedataTransfer
is of type'text/plain'
andselection
is someRangeSelection
but not the current selection, i.e. notselection !== $getSelection()
The current behavior
$insertDataTransferForRichText
inserts text from thedataTransfer
parameter to the current selection ($getSelection()
)The expected behavior
$insertDataTransferForRichText
should insert text from thedataTransfer
parameter to theselection
parameter as per the function descriptionFor context, I was using this function for a "replace all" function for a find and replace tool. Naturally I don't want to set the current selection to each selection to be replaced; I just want to iteratively create range selections to replace with rich text.
The text was updated successfully, but these errors were encountered: