WebTextArea Can't select text

Can any one tell me how to make the WebTextArea allow copy with the mouse. You can do it with the arrow keys but not the mouse by dragging. I have an app that the users seem only to know how to hi-light and copy is by placing the cursor at the start point and click and drag across the text they want.

This works for normal text fields. This problem has existed since web projects were possible.

Thanks

[quote=416288:@Richard Albrecht]Can any one tell me how to make the WebTextArea allow copy with the mouse. You can do it with the arrow keys but not the mouse by dragging. I have an app that the users seem only to know how to hi-light and copy is by placing the cursor at the start point and click and drag across the text they want.

This works for normal text fields. This problem has existed since web projects were possible.

Thanks[/quote]
I’m having trouble reproducing this with a textarea dragged directly from the library

https://www.dropbox.com/s/56eplj9bxe6lh6g/WebTextAreaSelection.mp4?raw=1

Do you have code in any of the textarea’s events which might be blocking the selection? or a sample that we can look at?

I was able to select the text with the mouse (hi-light), macOS 10.12.6, Safari, Chrome and Firefox.

What I can’t do is right click the mouse to get the option there to Copy/Paste as I normally do on other webpages. But I can Copy/Paste using the app menu or the shortcut.

That’s not surprising. The web framework overrides the built-in contextual menu so it can show its own.

It is surprising for me :slight_smile:

After working with desktop apps and get the built-in contextual menu if I don’t use ConstructContextualMenu to build my own, I expected something like that on web too.

There is no clipboard on web, I guess I can’t create a contextual menu like the built-in one with Copy/Paste right?

No, the web contextual menu is not an actual menu it’s a DOM element created by Xojo.

The only thing I have in the events of the textarea is the double click:

if me.Left = 10 and me.top = 115 then
me.left = 10
me.top = 8
me.width = 877
me.height = 522
me.ZIndex = 100
else
me.left = 10
me.top = 115
me.width = 431
me.height = 134
me.ZIndex = 1
end

Well we’ll need to see a sample project then because I have no way to figure this out at this point.

I created a test with one window and it worked.

The TextArea is in a Container control, there’s no events on that except open.

The problem is there are roughly 12 Container controls all the same size as the window, and stacked. Making them visible and invisible.

The normal text fields work fine.

Depending on what the DOM looks like, this may be the source of the problem.
What browser / OS / version for both?

Now see… those are important facts that you omitted from your original post. We might have been able to help a lot sooner with that info.

It is surprising for me :)[/quote]
If you are interested in changing this, you may want to vote on <https://xojo.com/issue/23071>
In <https://xojo.com/issue/13742> the possibility to access to the client’s clipboard is tracked, although this is seems to be unlikely to happen soon, given the current browser’s support.

Ok guys, I’ve heard of DOM, but don’t know anything about it.

How do I tell, I poked around the Chrome Developer tools…

Thanks

DOM stands for Document Object Model, or the objects on the webpage. If you have something overlapping the text area, even if it is not visible, it may be intercepting the text selection for the visible text area underneath it.

You need to determine if the text area you’re trying to select text from is underneath something.

OK you may have hit on something. The app has approximately 12 containers all on one window. I make them visible when the one is need. I though that was the best way to go as apposed to 12 separate windows.

Is that why I have my problem.

Well I just created a test project with several container controls behind another with a text area and it worked as expected.

So it’s not that the containers are stacked, unless I’m missing something.

Alright just created a test with 2 containers, one large on top level and one smaller inside the one on top. Each has textarea.

When the container on bottom is hidden you can select text normally but when the back ground is shown you cant select text as you would expect.

I don’t believe I have any containers visible on top of the text areas.

I’m going to try messing with the zlindex.

Just tried setting the zindex to 100 and that did not solve problem.