# WebViewPluginDemo JUCE8.. focus issue

**URL:** <https://forum.juce.com/t/webviewplugindemo-juce8-focus-issue/61542>\
**Category:** General JUCE discussion\
**Created:** [May 25, 2024, 6:16pm UTC](https://forum.juce.com/t/webviewplugindemo-juce8-focus-issue/61542 "2024-05-25T18:16:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rory](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rory/32/534_2.png) [@rory](https://forum.juce.com/u/rory)\
**Post date:** [May 25, 2024, 6:16pm UTC](https://forum.juce.com/t/webviewplugindemo-juce8-focus-issue/61542/1 "2024-05-25T18:16:53Z")

</div>

I just tested the WebViewPluginDemo example, and it seems that one must click the plugin interface before any interaction can take place if focus has been lost. Is there any way around this, I’ve been digging through the webkit code, experimenting with all sorts of things, but I can’t seem to find any way around it. Is it just me or does this represent a real problem when using webviews in plugins?

---

<div class="post-metadata">

**Author:** ![sudara](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/sudara/32/8071_2.png) [@sudara](https://forum.juce.com/u/sudara)\
**Post date:** [May 26, 2024, 2:03pm UTC](https://forum.juce.com/t/webviewplugindemo-juce8-focus-issue/61542/2 "2024-05-26T14:03:27Z")

</div>

Not sure about JUCE 8, but I know this was an issue with choc, there’s been [some discussion in the discord](https://discord.com/channels/382895736356077570/986959481097297980/1107610579021082694) something about [acceptsFirstMouse](https://developer.apple.com/documentation/appkit/nsview/1483410-acceptsfirstmouse?language=objc) on macOS. See also the discussion around [keyboard events](https://discord.com/channels/382895736356077570/1218213251553165393/1237422491266187445).

---

<div class="post-metadata">

**Author:** ![rory](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rory/32/534_2.png) [@rory](https://forum.juce.com/u/rory)\
**Post date:** [May 26, 2024, 2:33pm UTC](https://forum.juce.com/t/webviewplugindemo-juce8-focus-issue/61542/3 "2024-05-26T14:33:28Z")

</div>

Thanks @sudara - I find it so hard to find things on discord! So this is key:

> **[acceptsFirstMouse: | Apple Developer Documentation](https://developer.apple.com/documentation/appkit/nsview/1483410-acceptsfirstmouse?language=objc)**
>
> Overridden by subclasses to return if the view should be sent a message for an initial mouse-down event, if not.

After that it’s all good 🙂

---

<div class="post-metadata">

**Author:** ![sudara](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/sudara/32/8071_2.png) [@sudara](https://forum.juce.com/u/sudara)\
**Post date:** [May 26, 2024, 2:39pm UTC](https://forum.juce.com/t/webviewplugindemo-juce8-focus-issue/61542/4 "2024-05-26T14:39:18Z")

</div>

Yeah, exactly, it was [fixed in choc here](https://github.com/Tracktion/choc/commit/37f8f48bb93df41e97c2d1e0e84df9cc6ab9fd76) maybe @attila can take a look if it’s still a problem on JUCE 8…

---

<div class="post-metadata">

**Author:** ![attila](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/attila/32/11206_2.png) [@attila](https://forum.juce.com/u/attila)\
**Post date:** [May 28, 2024, 9:16am UTC](https://forum.juce.com/t/webviewplugindemo-juce8-focus-issue/61542/5 "2024-05-28T09:16:11Z")

</div>

We’ll look into this. Thank you for bringing this up.

---

<div class="post-metadata">

**Author:** ![attila](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/attila/32/11206_2.png) [@attila](https://forum.juce.com/u/attila)\
**Post date:** [June 10, 2024, 3:11pm UTC](https://forum.juce.com/t/webviewplugindemo-juce8-focus-issue/61542/6 "2024-06-10T15:11:59Z")

</div>

A fix has been released on the `juce8` branch

> <https://github.com/juce-framework/JUCE/commit/0d8b05e8ee138cdeb091551ff34f70eac820547d>
>
> The default is enabled to behave similarly to NSViewComponentPeer. The
> behaviour… for the old Apple WebView is unchanged.
