I am using a WebView control to show some html pages and now i have to support text selection feature on this
browser control. I am plannig to show some ActionMenus to user once he select some text
User hit on control and start text selection by dragging
User doubleclick on a text and select the text
If its a touch device user do tap event and might select the text
So how can i raise the event to show the Menus to end user
KeyDown
KeyUp
DragEnter
DragLeave
DoubleTapped
DO i need to use all these events to make it work on both keyboard/mouse interaction & touch interaction
WebView does not natively support the events that you have specified.
Refer : WebView Documentation - Events section.
Also read the Remarks section to find a workaround for your problem.
Quick read from documentation : WebView doesn’t support most of the user input events inherited from UIElement, such as KeyDown, KeyUp, and PointerPressed. A common workaround is to use InvokeScriptAsync with the JavaScript eval function to use the HTML event handlers, and to use window.external.notify from the HTML event handler to notify the application using WebView.ScriptNotify.
Related
The docs doesn't mention this, but does anyone know if it's possible to only show the DatePicker on icon click (or button), and not when the input field receives focus?
Users will primarily enter dates using the keyboard and doesn't want the DatePicker displayed, unless specifically asked for.
You can have a look here for the complete API which has some options that are not documented on the AntDesign site. But there is no option to achieve what you are looking for.
You need the combination of a text input with a button to popup the picker, which is a different paradigm from the one <DatePicker> uses. It could be "hacked" by combining a normal <Input>, <DatePicker> with custom CSS that only shows the button, and some Javascript event handlers.
I'm trying to set up automatically focus on first loaded article. (f.e. user clicks on the button "load more" and new articles are loaded).
My react implementation:
I'm using ref attribute in <Link> component, which is from react-router library and then I'm calling focus() method in lifecycle method componentDidMount().
It works on all devices except iOS. If I turn on voiceover on iphone and then on webpage I click on the button, it doesn't automatically focus on first loaded article). It works just with html anchor tag.
I read some articles before and it looks that it's not possible to do this in this way but only with firing some event f.e. click event.
Can someone confirm that it's not possible to solve it in this way or there is any workaround without using jquery ?
In JavaFX WebView I can view view html pages. Although shortcut to find a word doesn't work there (Ctrl+F).
How can I enable Ctrl+F functionality?
WebView does not support this functionality.
I raised a feature request for it. The feature is not scheduled for implementation. You can vote for it if you like.
You can implement the find functionality yourself.
An example would be to create a new HBox in your FX scene that opens when it detects the CTRL+F event with a TextField for typing into. After this, you'll need to make it so that every time you type in the TextField it will fire off an event to a method where you implement some Javascript that searches through the DOM of your current page based on what you typed in to find. You can also make it so that your script highlights the word it found, amongst other find related tasks.
I have a <div> with some text and I would like the user to be able to natively select the text. The issue is that when I attach any mouse event handler to the element or it's parent (besides document element) the selection won't work any longer.
This could be observe on the site linked below. If you sink mouse events the selection won't work for the first line.
http://rafalrybacki.com/lab/selection_ios/
What happens after clicking "sink mouse events" is:
main.sinkEvents(Event.MOUSEEVENTS);
Checked with iOS5.
I would like make the text selecting work (keeping the mouse events). How to do this?
I have a WebView and I want to detect when the user clicks a link. However, there is no event that occurs when the user clicks a link. In Silverlight, WinForms, and WPF, there was the WebBrowser control with the Navigating event, but WinRT's WebView seems to be lacking many events. I cannot modify the web page as I am not the owner of it. Is there any way to detect when the user clicks a link?
In addition, the Source variable does not change when the user clicks a link, only when it is manually assigned to.
The idea is to alter the source HTML for all links to call a custom OnClick script, and attach an event handler to the ScriptNotify event of the WebView