Textarea scroll disabled on Win when using MouseDown/Up

Hello. I recently discovered a part in my app isn’t working as expected on Windows. This is a multiple choice exam app. I made a change recently where the user could click on the answer in the textarea by implementing MouseDown and MouseUp instead of them having to click the tiny radiobutton. I just noticed that when the text is large where the user would normally have to scroll down to read the entirety that this isn’t working. Took out the mouse down/up momentarily, and it worked but not ideal

I like using the mouse down/up as an alternative to selecting the radiobutton but this can be problematic if there is a lot to read in the answer choice. Mac seems to be working as expected. This is just in Windows. I tried in the past having a canvas overlay the textarea, but this didn’t work well for me

Any thoughts on what I can try?

Without knowing what you are doing in the MouseUp and MouseDown events, it’s kinda hard to guess. A simple test on my system did not show a problem. Let us see the code or a sample project that displays the issue. Also, what version Xojo and Windows are you using?

Hi Dale. Sorry for not mentioning more. I use the MU/MD to select the the radiobutton when the user clicks on the textarea corresponding to the answer choice. Four radiobuttons for choices a, b, c, d. Four textareas for answers a, b, c, d. Click on either the radiobutton (not ideal since so tiny) or click on the textarea answer choice (larger clickable area). Clicking on the textarea selects the radiobutton for the user’s choice

Code in the MouseUp for each textarea, but each is different for selecting the appropriate answer:

[code]if btnSave.Enabled = True then
rdbAns2.Value = True

rdbAns1.Value = False
rdbAns3.Value = False
rdbAns4.Value = False
end if[/code]

MouseDown just has Return True

Using latest version of Xojo 18r4 (the version on my Windows may have been built with 18r3), and on Windows 10 machine

I’ll try to make up a quick demo project and post here. Watch I won’t be able to recreate :slight_smile:

Here is a demo with instructions
TextAreaClick project

On Xojo 18r3 and Windows 10

I think the problem is that when you click in the textfield1 you are immediately telling the system that the MouseDown event has been totally handled. This means that the mouse button events are not being processed further by the system. That includes the MD/MU events in the scrollbar. You might have to devise a different method to do what you need to do.

I think you’ve found a bug there. With the border turned off as you have here, a mouse leave event is being raised by the textarea control just after the mouse down (checked with spy++) but only when you are on the left half of the scrollbar.

If I were a betting man, I’d say that they’ve not taken into account the width change of things when the border is removed and they haven’t moved it far enough left, whatever it is that is wrong.

Here’s a fix inside, look inside TextArea1.Open where I remove the style to revert back to no border, it just needs to run with the border on in the IDE so the bug doesn’t happen.


Hope it helps.


Awesome! Thanks so much Julian! That does the trick. Thank you also for going ahead and submitting a bug report

Much appreciated!