Open Bug 2025533 Opened 1 month ago Updated 1 month ago

Can't edit values in box model if text is selected in devtools

Categories

(DevTools :: Inspector, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: leo, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached video Screencast of STR

If text is selected elsewhere in the inspector panel in devtools, clicking on the numbers in the "Box Model" view to change them doesn't work.

Simple STR:

  1. open data:text/html;charset=utf-8,<!doctype html><body><style>body {%0A%20 background: red;%0A}</style></body>
  2. double click on "x" between the height and width values to select it
  3. click on the height or width value to edit them

Expected outcome:
The height or width value transforms into an input for editing

Actual outcome:
Nothing happens

Might be related to https://searchfox.org/firefox-main/rev/26c440c6196eb0b428928d995395c97101d393f4/devtools/client/shared/inplace-editor.js#264-275

element.addEventListener(trigger, function (evt) {
  if (!isValidTargetForEditableItemCallback(evt.target)) {
    return;
  }

  const win = this.ownerDocument.defaultView;
  const selection = win.getSelection();
  if (trigger != "click" || selection.isCollapsed) {
    callback(element, evt);
  }
  evt.stopPropagation();
});

If correct, we should if the selection potentially overlaps the element for the inplace editor.

Severity: -- → S3
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: