Opened 7 years ago

Closed 7 years ago

#15801 closed defect (invalid)

Dialog: problem in window.location.hash in onCancel method

Reported by: rejukg Owned by:
Priority: undecided Milestone: tbd
Component: Dijit Version: 1.2.3
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

Hi I have a problem in Dialog component onCancel method. The scenario is whenever user closes the dojo dialog , user should be anchored or scrolled to a particular section of that page.

OnCancel:function(){
  window.location.hash="sectionmarker";
}

The problem is the above code is moving the screen to the hashed section(section marker) which is fine , but then after immediately it is moving/scrolling the screen back to intial state.

Change History (3)

comment:1 Changed 7 years ago by rejukg

This is happening in IE7 & IE9

comment:2 Changed 7 years ago by rejukg

Ok guys,

I think I got it ..The solution is to disable the focus

autofocus:false, refocus:false,

comment:3 Changed 7 years ago by bill

Component: GeneralDijit
Description: modified (diff)
Resolution: invalid
Status: newclosed
Summary: Dojo dijit.Dialog | Problem in window.location.hash in onCancel methodDialog: problem in window.location.hash in onCancel method

Yes, it makes sense to set refocus:false if you want to send the focus somewhere else than the button that displayed the dialog.

But also, you probably should be waiting until the Dialog finishes hiding before doing anything, so you should be connecting to onHide not onCancel.

Note: See TracTickets for help on using tickets.