Welcome Guest Search | Active Topics | Sign In | Register

Restoring focus issue Options
John Dunn
Posted: Monday, September 27, 2021 5:55:33 PM
Rank: Newbie
Groups: Member

Joined: 9/21/2021
Posts: 4
In WPF if I have a item that currently has focus, if I select a menu item, after executing the menu item focus is returned to the item that had focus. I'm trying to replicate that with a WebView and not having any luck.

In my example, if I give focus to the HTML textarea and then select the Test menu item the textarea loses focus. If I replace the HTML content with standard XAML the focus is returned correctly. It's easy to see this behavior

1. click in WPF textbox
2. select menu item
3. type - content will change in textbox
4. click in HTML textarea
5. select menu item
6. type - content does not go in textarea

My example is

XAML
Code: XML
<Window 
  x:Class="WpfApp6.MainWindow"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:eo="http://schemas.essentialobjects.com/wpf/"
  mc:Ignorable="d"
  Title="MainWindow" Height="450" Width="800">
  <DockPanel LastChildFill="True">
    <Menu DockPanel.Dock="Top">
      <MenuItem Header="Tools">
        <MenuItem Header="Test"></MenuItem>
      </MenuItem>
    </Menu>
    <DockPanel LastChildFill="True">
      <Grid>
        <Grid.RowDefinitions>
          <RowDefinition/>
          <RowDefinition/>
        </Grid.RowDefinitions>
        <Canvas>
          <TextBox Width="200" Height="100"></TextBox>
        </Canvas>
        <eo:WebControl Grid.Row="1" x:Name="eob"/>
      </Grid>
    </DockPanel>
  </DockPanel>
</Window>


c#
Code: C#
using EO.WebBrowser;
using System.Windows;

namespace WpfApp6
{
  public partial class MainWindow : Window
  {
    public MainWindow()
    {
      InitializeComponent();
      eob.WebView = new WebView
      {
        Url = "file:///...test.html"
      };
    }
  }
}


HTML
Code: HTML/ASPX
<html>
  <textarea id="txt" rows="4" cols="50">
    At w3schools.com you will learn how to make a website. They offer free tutorials in all web development technologies.
  </textarea>
</html>
eo_support
Posted: Tuesday, September 28, 2021 9:33:30 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
Hi,

This is just to let you know that we are still working on this issue. We are able to reproduce the problem, but we are still trying to find out the root of the problem. We will reply here again when we have an update.

Thanks!
eo_support
Posted: Wednesday, October 6, 2021 4:21:00 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
Hi,

We are able to resolve this issue on our end. The fix will be in our next build. We will reply here again when the new build is available.

Thanks!
eo_support
Posted: Tuesday, October 12, 2021 3:04:27 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
Hi,

This is just to let you know that we have posted a new build that should resolve this issue. Please download the new build from our download page and let us know how it goes.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.