cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BenPrescott
New Member

Reset the scroll bar on HTML text field

Hi All,

 

I have an HTML Text field (needed for a mixture of fonts types) that basically contains hint text. I’ve set a Boolean value to make this visible or hidden depending on whether the users clicks an I indicator or the close icon.

 

The issue I have is that the scroll bar stays where it is when it’s re-hidden and I’d like it to scroll back to the top.

 

I tried Reset(Q1HintText) on the close buttons OnSelect property (following the update context and with a semi colon) but it shows an error.

 

Any help would be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@BenPrescott 

The only real way to get those to go back to the top is by changing their data.

So, for example, if your Q1Hint.HtmlText property was set to a variable instead of the actual html you want you can "fake it out" and it will reset.

 

Something like this:

UpdateContext({lclHtmlText: Blank()});

UpdateContext({lclHtmlText: "<b>Your Html Text Here</b>"})

 

Then have your HtmlText property on the Q1Hint control set to lclHtmlText.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

4 REPLIES 4
RandyHayes
Super User
Super User

@BenPrescott 

The only real way to get those to go back to the top is by changing their data.

So, for example, if your Q1Hint.HtmlText property was set to a variable instead of the actual html you want you can "fake it out" and it will reset.

 

Something like this:

UpdateContext({lclHtmlText: Blank()});

UpdateContext({lclHtmlText: "<b>Your Html Text Here</b>"})

 

Then have your HtmlText property on the Q1Hint control set to lclHtmlText.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Thank you so much for this. This worked with a slight alteration for me. 

The UpdateContext({IcIHtmlText: Blank()}) needed to be on the close button and UpdateContext({IcIHtmlText: “<b>Your Html Text Here</b>”}) on the Q1 hint control. 

For some reason when both update contexts are on the Q1 hint control the scroll remained where it was.

 

Again, thank you so much!!

RandyHayes
Super User
Super User

@BenPrescott 

I had a feeling it would not work quite as described because they were both together and kind of the way it works...the control will not alter its information until the formula completes.  Since your final function in the formula set it back, it really noticed no difference.

Glad you were able to get it going.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
RufusOpus
Regular Visitor

Following up, I totally grabbed this and put it with a timer so that multiple HTML text controls can display the content from a multiple-line field in a SPO list (that I'm pasting the HTML into directly from word through the RichText input control, it just takes the Word formatting and converts it to html and an HTML text box just shows it, no problem. Heckin' heck! What a time to be alive.)

 

On a rectangle, configure Onselect to Set(var_GlobalVariable,"Selection"), then UpdateContext({HtmlText: Blank()}), then UpdateContext({TimerGo: true}).

On a timer, set Start to TimerGo (ty Shane Young), and OnTimerend, have it UpdateContext({HtmlText: var_GlobalVariable}).

 

On the HTML Text control, set the property HTMLText to LookUp(SPOSource,Title=HtmlText).Selection.

 

There's probably a more elegant way to do it, but this what it looked like when I put the hammers down.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,879)