odd scrolling behaviour of text field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
odd scrolling behaviour of text field
Hi,
I noticed a strange scrolling behaviour of a textfield. When I hit the return key in a field that is already scrolled to the bottom, the field would react with a strange scroll showing the newly created line at the bottom of the field. This behaviour is a bit annoying since I always need to scroll up to read my text, when hitting return again it jumps again down to the bottom. I made an image to illustrate my point. The small red bar is indicating the position of my cursor. Can you replicate this? Is it how it should be or? MacOs12.6. / LC 9.5 indy.
Thanks for any hints.
Best
Oliver
PS. The text is from the infamous S.C.U.M. Manifesto - in case you were wondering....
I noticed a strange scrolling behaviour of a textfield. When I hit the return key in a field that is already scrolled to the bottom, the field would react with a strange scroll showing the newly created line at the bottom of the field. This behaviour is a bit annoying since I always need to scroll up to read my text, when hitting return again it jumps again down to the bottom. I made an image to illustrate my point. The small red bar is indicating the position of my cursor. Can you replicate this? Is it how it should be or? MacOs12.6. / LC 9.5 indy.
Thanks for any hints.
Best
Oliver
PS. The text is from the infamous S.C.U.M. Manifesto - in case you were wondering....
Re: odd scrolling behaviour of text field
Not sure what to suggest here. This is the expected behaviour when I try it:
The new line appears without scrolling the text field to the bottom.
One thing I could think of, where did you copy your text from? Perhaps there's some characters (unicode or something) in the text that livecode doesn't like?
My test is in Livecode Community 9.5.0. Mac OS X 10.11.5
The new line appears without scrolling the text field to the bottom.
One thing I could think of, where did you copy your text from? Perhaps there's some characters (unicode or something) in the text that livecode doesn't like?
My test is in Livecode Community 9.5.0. Mac OS X 10.11.5
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: odd scrolling behaviour of text field
Hi Oliver,
Tested (LC business 9.5.0, OS X 10.13). Works as expected
Sorry no idea
Best regards
Jean-Marc
Tested (LC business 9.5.0, OS X 10.13). Works as expected
Sorry no idea
Best regards
Jean-Marc
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 9655
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: odd scrolling behaviour of text field
Tested here. LC creates a new line at the insertion point, and all looks normal. This is with random text packed into a single scrolling field.
LC 9.5.1. Mac OS 10.13.4
Craig
LC 9.5.1. Mac OS 10.13.4
Craig
Re: odd scrolling behaviour of text field
Hi guys, thanks for testing. I still have the behaviour in various iterations of LC. The text is clean, no special formatting etc. I attach a sample stack. Do as follows:
- open stack
- scroll text field to the bottom (this is important!)
- select before phrase: ""The male is a biological..."
- hit return
in my case the the phrase "The male is a biological..." will appear now on the bottom of the field.
Please tell me that I am not insane...
Thanks.
Oliver
- open stack
- scroll text field to the bottom (this is important!)
- select before phrase: ""The male is a biological..."
- hit return
in my case the the phrase "The male is a biological..." will appear now on the bottom of the field.
Please tell me that I am not insane...
Thanks.
Oliver
- Attachments
-
- scrolltest.livecode.zip
- (1.31 KiB) Downloaded 195 times
-
- VIP Livecode Opensource Backer
- Posts: 9655
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: odd scrolling behaviour of text field
Hi.
Did what you said. Put a return before the phrase you mentioned. That portion of the text was set down one line, so that a blank line separated the word "reproduction" from the word "The".
This is what I would have expected. Know that in the original text, the phrase of interest already had a hard return after "reproduction" which is why the empty line appeared between them.
So please tell me again what happens when you do this.
Craig
Did what you said. Put a return before the phrase you mentioned. That portion of the text was set down one line, so that a blank line separated the word "reproduction" from the word "The".
This is what I would have expected. Know that in the original text, the phrase of interest already had a hard return after "reproduction" which is why the empty line appeared between them.
So please tell me again what happens when you do this.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 9655
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: odd scrolling behaviour of text field
Hey, is it the scroll that you are talking about, and not the formatting of the text?
That the scroll does not "stay down", that is, since it was at its max before the return, why is it not at the max after? Or at least only one lines's worth of scroll above?
Since all you did was add a return? Well, not sure. But there is always a way to hold the scroll at the bottom after the return, though a kluge. Do you need help with something like that?
Craig
That the scroll does not "stay down", that is, since it was at its max before the return, why is it not at the max after? Or at least only one lines's worth of scroll above?
Since all you did was add a return? Well, not sure. But there is always a way to hold the scroll at the bottom after the return, though a kluge. Do you need help with something like that?
Craig
Re: odd scrolling behaviour of text field
Hi Craig,
yes, I was just wondering why the scroll jumps and doesn't stay down when I only insert a Return. My image in the original post explains the behavior I would expect. Can you confirm the behaviour? Is it a bug or intended? I used the follwoing code to work around this behavior, but it is ugly, since the lock screen seems not to work in the rawkeyup handler, so the user sees the jump.
Best
Oliver
yes, I was just wondering why the scroll jumps and doesn't stay down when I only insert a Return. My image in the original post explains the behavior I would expect. Can you confirm the behaviour? Is it a bug or intended? I used the follwoing code to work around this behavior, but it is ugly, since the lock screen seems not to work in the rawkeyup handler, so the user sees the jump.
Code: Select all
local currentscroll
on rawkeyDown
put the scroll of me into currentscroll
pass rawKeyDown
end rawkeyDown
on rawKeyUp theKey
if theKey is "65293" then
lock screen
if (the formattedheight of me - the height of me - currentscroll) < 50 then set the scroll of me to currentscroll+20
unlock screen
end if
end rawKeyUp
Oliver
-
- VIP Livecode Opensource Backer
- Posts: 9655
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: odd scrolling behaviour of text field
Try this in the field script:
Craig
Code: Select all
on returnInField
put return after the selectedChunk
set the scroll of me to 100000
end returnInField
Re: odd scrolling behaviour of text field
Hi Craig,
thanks, this works. Still I wondering if my observed behaviour is expected or a bug and is it only me. Oliver
thanks, this works. Still I wondering if my observed behaviour is expected or a bug and is it only me. Oliver
-
- VIP Livecode Opensource Backer
- Posts: 9655
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: odd scrolling behaviour of text field
I would bet $1 that it is expected behavior, but for no important reason. I would bet $2 that I am wrong about that.
Craig
Craig
Re: odd scrolling behaviour of text field
If I am interpreting you correctly, you actually believe it is a bug, since you bet more money on it? o
-
- VIP Livecode Opensource Backer
- Posts: 9655
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: odd scrolling behaviour of text field
Nobody has ever interpreted me correctly.
I am sure everyone sees what you do. I certainly do.
This small but noticeable effect ought to cause others to chime in. Everyone know what the issue is?
Craig
I am sure everyone sees what you do. I certainly do.
This small but noticeable effect ought to cause others to chime in. Everyone know what the issue is?
Craig