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?
Related
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.
I have a questionnaire with buttons that show a tooltip on mouse hover and select on mouse click.
On mobile devices, ToolTip captures the first click to show the tool tip (equivalent of "hover" on computer) and the second click is used for button selection (equivalent of "click" on computer).
Now my question: how, on a mobile device, can I use the first click to both show the tooltip AND select the button ?
Is there a way I can e.g. propagate the event to make it act like on a computer ?
Or intercept the first event and trigger another event ?
Or should I act at the level of the button by catching the event and manually trigger tooltip showing ? (in which case I'll also need to figure out how to hide the tooltip when a button from another question is clicked).
Or perhaps JQuery-UI ToolTip is not adapted to my needs?
Thanks ahead for your views
LA
Finally I found an acceptable solution by manually hooking a click event to the buttons as follows:
$(".questionnaire_button").click(function () {
$(this).tooltip({
position: { my: "left+15 center", at: "center+20 center" }
});
$(this).tooltip("open");
})
I'm using iOS 5.0.1, and Sencha Touch 2-rc1. I have a search input field where the focus event is getting triggered, as well as the submit event when I press 'Search' on the on-screen keyboard. The blur event doesn't get triggered when I expect it to, which would be when the 'Done' key is pressed, or the viewable area is tapped.
Note that the blur event IS getting triggered on my laptop in Chrome.
Not every element is focusable. At least <div> is not.
onblur is not firing because when a user taps on a div element, the focus doesn't go to the <div>.
Based on this post:
http://snook.ca/archives/accessibility_and_usability/elements_focusable_with_tabindex
tabindex on the correct div element can make a div focusable.
This is likely to be related to the event not "bubbling" up through the DOM. Or perhaps the code you've used includes an event.preventDefault(), but that would have killed more than just blur. I've also had this issue with clicking away from items which appear via javascript.
http://www.quirksmode.org/dom/events/blurfocus.html
I have just noticed a strange behavior of ComboBox component. I am using it in DropDownList style. If I click on it, it drops down the list of items, as usual. But then if I click on some other component on the form, the combobox will not let me leave it, unless I select one of the items. I thought of adding onmouseleave event, but in that case it would close even if I move mouse out of combobox area a little, which is undesirable. What I would like to see is combobox losing focus whenever i click somewhere outside of its area. Is that possible?
Actually, I just did what you did: started a new application and threw ComboBox and TEdit. Ran the program. It drops down the list just as you said when you clicked on it. Also, when I clicked on the TEdit, the combobox closed automatically as expected. So, I don't know what is the problem with your program.
I have the following situation
I handle when the left mouse button is pressed in my Silverlight app and do some things while the mouse is held down and the mouse moves. When the left button is released, I turn off the flag that's telling it to do the stuff and the mouse movement handler then no longer does the stuff.
The problem is: if the user is in the control area, pushes the left button down and moves out of the control area, then releases the button and reenters, the MouseLeftButtonUp event never fires and the processing continues until the user clicks the mouse.
My temporary fix was to turn the mouse flag off on MouseLeave but that's not really what I'm going for. I'd like to check to see the mouse's left button state in the MouseEnter event, but I don't know of a way to do that.
Does anyone know of a way I can access the mouse button state outside of the press events in Silverlight 3? Thanks,
Update
After thorough research, it doesn't look like this is possible in Silverlight 2 (and probably 3.) I found this link. If anyone knows of a workaround, please let me know.
What you need to do can be accomplished with the UIElement.CaptureMouse method:
http://msdn.microsoft.com/en-us/library/system.windows.uielement.capturemouse%28VS.95%29.aspx
When a UIElement has captured the mouse, it will continue to receive mouse events even if the mouse leaves the Silverlight control.