versotile-org/verso

Focus `<Input>` between webviews need to blur to reset focus state to input

Closed this issue · 3 comments

Switching <input> focus between main view and panel view needs to blur it first and focus it again to allow input

CleanShot.2024-07-03.at.15.12.42.mp4

This is caused by we didn't focus the webview when the webview should be focused. We can fix this by sending focus event based on EventDelivered. I guess MouseButtonEvent is enough for now.

EmbedderMsg::EventDelivered(event) => {
    if let CompositorEventVariant::MouseButtonEvent = event {
        events.push(EmbedderEvent::RaiseWebViewToTop(p, false));
        events.push(EmbedderEvent::FocusWebView(p));
    }
}

@Taym95 Are you interested in this one? This is fairly simple and it's good chance to get familiar with verso's codebase structure.

Yes I will pick it up.