Skip to content

feat: add focus and blur events for WebContents - #25873

Merged
zcbenz merged 1 commit into
electron:mainfrom
samuelmaddock:feat/webcontents-focus-events
Feb 1, 2022
Merged

zcbenz merged 1 commit into
electron:mainfrom
samuelmaddock:feat/webcontents-focus-events

Conversation

@samuelmaddock

@samuelmaddock samuelmaddock commented Oct 10, 2020 •

Copy link
Copy Markdown
Member

Description of Change

Adds 'focus' and 'blur' events to WebContents.

resolves #22201

cc @electron/wg-api

Checklist

Release Notes

Notes: Added 'focus' and 'blur' events to WebContents

@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Oct 10, 2020
samuelmaddock added a commit to samuelmaddock/electron-browser-shell that referenced this pull request Oct 10, 2020
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Oct 11, 2020
@samuelmaddock

Copy link
Copy Markdown
Member Author

@electron/wg-releases requesting to add 11-x-y backport label 🙇

@nornagon nornagon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's have a test :)

@jkleinsc

Copy link
Copy Markdown
Member

The API WG approved this at our Oct 19 2020 meeting.

@samuelmaddock

Copy link
Copy Markdown
Member Author

@nornagon Tests added

@nornagon

Copy link
Copy Markdown
Contributor

Just to clarify, does this event also trigger when the browserwindow is focused (e.g. through alt+tab)? or only when focus stays in the browser window and switches between webcontentses?

@samuelmaddock

Copy link
Copy Markdown
Member Author

Just to clarify, does this event also trigger when the browserwindow is focused (e.g. through alt+tab)? or only when focus stays in the browser window and switches between webcontentses?

It does trigger when focusing the BrowserWindow. I've added a test to confirm: 89ad21d

@nornagon

Copy link
Copy Markdown
Contributor

@samuelmaddock it looks like the new test is failing on macOS.

@jkleinsc

Copy link
Copy Markdown
Member

The releases WG approved this PR for backport to 11-x-y at the Oct 28, 2020 meeting

@jkleinsc

jkleinsc commented Nov 2, 2020

Copy link
Copy Markdown
Member

@samuelmaddock any updates on this? Looks like we are close to being able to merge this if the test failures can be resolved.

@samuelmaddock

Copy link
Copy Markdown
Member Author

@samuelmaddock any updates on this? Looks like we are close to being able to merge this if the test failures can be resolved.

No updates, I'll see if I can get around to this by the end of the week.

@lockieluke

Copy link
Copy Markdown

please get this merged asap

@jolindroth

jolindroth commented Dec 28, 2021 •

Copy link
Copy Markdown

Any updates?

@samuelmaddock @jkleinsc @nornagon

@nornagon nornagon added the semver/minor backwards-compatible functionality label Jan 28, 2022
@samuelmaddock
samuelmaddock force-pushed the feat/webcontents-focus-events branch from 89ad21d to 8ceab22 Compare January 28, 2022 18:47
@samuelmaddock
samuelmaddock requested review from a team as code owners January 28, 2022 18:47
@samuelmaddock
samuelmaddock force-pushed the feat/webcontents-focus-events branch from 8ceab22 to 644c749 Compare January 28, 2022 18:50
test: add focus and blur WebContents event tests

test: confirm that webcontents focus event is fired on browserwindow focus

fix: mac focus event test timeout
@samuelmaddock
samuelmaddock force-pushed the feat/webcontents-focus-events branch from 644c749 to d3a80e6 Compare January 29, 2022 21:09
@zcbenz zcbenz removed the wip ⚒ label Feb 1, 2022
@zcbenz
zcbenz merged commit aeee9cf into electron:main Feb 1, 2022
@release-clerk

release-clerk Bot commented Feb 1, 2022

Copy link
Copy Markdown

Release Notes Persisted

Added 'focus' and 'blur' events to WebContents

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add 'focus' & 'blur' events to BrowserView/WebContents

7 participants