RobYost Posted January 23, 2018 Share Posted January 23, 2018 I have a mobile scrollbox. I slide up to see the hidden part of the screen, when I let go it automatically goes back to the top of the scroll box so I can not select anything at the bottom of the scroll box. I have attached an mp4 screen capture of the problem, but it wouldn't let me upload a mp4 file, so I renamed it .txt. You will need to rename it back to mp4 to watch the video. In the video the first scroll box works OK, the second one is the one that pops back. Does anyone have any ideas? Thanks. UPDATE: I thought it might be related to being on a tabsheet, but I moved the scrollbox to the mainform, but the problem is the same. scrollbox .txt Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 23, 2018 Share Posted January 23, 2018 Hi, Would be better if you make a simple test case for this. Best regards, Quote Link to comment Share on other sites More sharing options...
RobYost Posted January 23, 2018 Author Share Posted January 23, 2018 If I fill the scrollbox in the create event it works If I fill it from a button click it does not. The project I sent will fail (scroll snaps back to top) but if you uncomment the line in the create event it will work. The problem with this is what ever size you load in the create event is how large the scroll box is for the rest of the program. ScrollBox.zip Quote Link to comment Share on other sites More sharing options...
RobYost Posted January 25, 2018 Author Share Posted January 25, 2018 I created a test case for this. Did anyone get a chance to look at it? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 26, 2018 Share Posted January 26, 2018 Hi Rob, Sorry for delay, I will check and let you know. Best regards, Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 26, 2018 Share Posted January 26, 2018 In your case, can you try to use this approach ?!: var i : Integer; top: Integer; txt: string; _top: Integer; // <----- for i := 0 to Length(aMemo) - 1 do begin ... end; _top := top - UnimScrollBox1.Height + UnimScrollBox1.Top; // <----- UnimScrollBox1.JSInterface.JSCode('var me='#1'; me.scrollableBehavior.scrollView.getScroller().maxPosition.y = '+ IntToStr(_top) +';'); // <----- Quote Link to comment Share on other sites More sharing options...
RobYost Posted January 27, 2018 Author Share Posted January 27, 2018 Thanks, it worked perfectly for my test project. It didn't work on my real project, so I am looking into what is different. If you have any ideas what could go wrong, please let me know. Thanks again. PS: I changed _top to 3000, but it still won't scroll down. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 27, 2018 Share Posted January 27, 2018 Hi, Can you try with "Ext.defer" ?!: UnimScrollBox1.JSInterface.JSCode('var me='#1'; Ext.defer(function(){me.scrollableBehavior.scrollView.getScroller().maxPosition.y = '+ IntToStr(_top) +'}, 500);'); Best regards, Quote Link to comment Share on other sites More sharing options...
RobYost Posted January 29, 2018 Author Share Posted January 29, 2018 Thanks, that fixed it! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.