mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 16:28:38 +09:00
Issue #1512 - Improve handling of multiple selections.
IsSelectionEditable should check whether the focus node and anchor node aren't null before trying to use them. This also changes the initialization of selections' aOutIndex to the last range in the selection as a fallback in case we don't add a range later (in AddItem) which could also end up with a null selection otherwise if the additional selection nodes are removed.
This commit is contained in:
parent
583b5c34a3
commit
92f7e0e48e
2 changed files with 9 additions and 3 deletions
|
|
@ -3844,7 +3844,7 @@ Selection::AddItem(nsRange* aItem, int32_t* aOutIndex, bool aNoStartSelect)
|
|||
|
||||
if (mUserInitiated) {
|
||||
AutoTArray<RefPtr<nsRange>, 4> rangesToAdd;
|
||||
*aOutIndex = -1;
|
||||
*aOutIndex = int32_t(mRanges.Length()) - 1;
|
||||
|
||||
nsIDocument* doc = GetParentObject();
|
||||
bool selectEventsEnabled =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue