Skip to content

[BUG] Playwright can't recognize [contenteditable] element inside a <button> #23652

@Dinh246

Description

@Dinh246

System info

  • Playwright Version: [v1.34.3]
  • Operating System: Window 11
  • Browser: All
  • Other info:

I've met this error when fill to contenteditable element inside a button:

image

We even test with this site and codegen:
https://play.vuejs.org/#eNq1kLFuwzAMRH/lqsXtUAtdCyVAt3YP0EWLEjO2AVkiZDpoYPjfS8dp/yAABx3vkSdwNh/M9WUi827ceCo9C0aSifc+9QPnIphR6IwF55IHVIpWPvl0ymkUDGOL3eo/V58UY8Z3LrF5ql58cnZbp4tUCA0cg5AqwHVv+3m+DS+Ls6pu3T7xJLi8DrmhuPNGfW8261hg769JJCfIlUmRTd0pdRn6LyGtppdwjCsjZSIlDl0/QiuAQwltCdzV+JK19QfXOJQrJOPUhdQSZB0R+pHa2fUgGmC3xE08Ns3Z/6OZ5ReROJF6
Steps

  • Record edit contenteditable element inside a button.
  • Record edit normal contenteditable element

Expected

Should record both fill actions in spec file

Actual

Only record the fill action with the last contenteditable element

DOM:
image

Source code

const inputField = this.frameLocator.locator("[contenteditable]");
    await block
      .getByRole("button")
      .or(this.page.locator("[class*=accordion__item]"))
      .nth(tab - 1)
      .dblclick();
    await inputField.waitFor();
    await this.page.keyboard.press("Control+A");
    if (typeof title !== undefined) {
      await inputField.fill(title);
    }
    await this.titleBar.click();
    await this.quickSettingsText.waitFor({ state: "hidden" });
    }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions