About Widget defaults to bottom of window?

615
4
01-04-2019 05:18 AM
EdApalinski
Occasional Contributor

When the About widget is opened the default view scrolls to the bottom of the text window instead of starting at the top.  Is there anyway to change this behavior?  The only work around I have found is to have the widget open at launch, however if it is closed and re-opened it scrolls to the bottom??  

Any advice? Thanks! Ed

Tags (1)
0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus

Edward,

  In will take a three line code fix to get what you want. In the about widget.js add this function:

      onOpen: function () {
        this.envelopeNode.parentNode.parentNode.scrollTop = 0;
      },
0 Kudos
EdApalinski
Occasional Contributor

Robert,

Thanks, however I do not believe I have access to the .js file since I am using the WAB template not the developers version?  Do you know if there is a way to add that function to the item's JSON?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Edward,

   No that is not something that can be handled in the JSON.

0 Kudos
EdApalinski
Occasional Contributor

Thanks to Tom Schwartzman from Esri a solution has been discovered.  So for some reason when the about widget is opened it jumps to the first hyperlink, which in my case was at the bottom of the text string.

A work around is to have a hyperlink in the top of the widget.  Or to really trick the widget, put an image at the top, use the View HTML Source tool and add the <a> html tag (<a> <img src=”imageinfo” /></a>).  The pic will show up but not show as a clickable link. 

0 Kudos