Opened 7 years ago

Closed 5 years ago

#9057 closed bug (fixed)

Core: scrollParent not working properly in IE for static or relative elements

Reported by: linus.yan87 Owned by:
Priority: minor Milestone: 1.10.4
Component: ui.core Version: 1.10.0
Keywords: Cc:
Blocked by: Blocking:

Description

For IE, element whose position is static or relative can't get the right scroll parent. Because it only checks parents which are positioned.

In fact, elements which have dimension(height|width is not auto) and overflow is auto|scroll, they are also scroll parent.

Change History (7)

comment:1 Changed 7 years ago by tj.vantoll

Status: newopen
Summary: In IE, scrollParent() function not working properlyscrollParent not working properly in IE

Confirmed the first part of this. scrollParent does not find non-positioned elements in IE - http://jsfiddle.net/tj_vantoll/scdC5/.

comment:2 Changed 7 years ago by tj.vantoll

linus.yan87,

Could you clarify or post a test case for this: "In fact, elements which have dimension(height|width is not auto) and overflow is auto|scroll, they are also scroll parent."

comment:3 in reply to:  2 Changed 7 years ago by linus.yan87

Replying to tj.vantoll:

linus.yan87,

Could you clarify or post a test case for this: "In fact, elements which have dimension(height|width is not auto) and overflow is auto|scroll, they are also scroll parent."

Test case address: http://jsfiddle.net/linus/N8Pmc/. In firefox, it will alert HTMLDivElement; But, in IE, it alerts HTMLDocument.

comment:4 Changed 7 years ago by ScottGaines

I also ran into this problem but i needed the draggable stuff to scroll when over flow was hidden so I extended the scrollParent function and that is when I found the IE issue.

Here is the extend I did to find this issue http://jsfiddle.net/g4M4t/3/

Here is the, I guess, kind of fix I came up with. I'm not sure if its a good fix or not. http://jsfiddle.net/g4M4t/6/

Working example http://jsfiddle.net/N8Pmc/2/

Last edited 7 years ago by ScottGaines (previous) (diff)

comment:5 in reply to:  4 ; Changed 7 years ago by linus.yan87

Replying to ScottGaines:

I also ran into this problem but i needed the draggable stuff to scroll when over flow was hidden so I extended the scrollParent function and that is when I found the IE issue.

Here is the extend I did to find this issue http://jsfiddle.net/g4M4t/3/

Here is the, I guess, kind of fix I came up with. I'm not sure if its a good fix or not. http://jsfiddle.net/g4M4t/6/

Working example http://jsfiddle.net/N8Pmc/2/

overflow:hidden is not allowed to have scroll bar, so it's not scroll parent. I'm inclined to advise you to change the height dynamically.

comment:6 in reply to:  5 Changed 7 years ago by ScottGaines

Replying to linus.yan87:

Replying to ScottGaines:

I also ran into this problem but i needed the draggable stuff to scroll when over flow was hidden so I extended the scrollParent function and that is when I found the IE issue.

Here is the extend I did to find this issue http://jsfiddle.net/g4M4t/3/

Here is the, I guess, kind of fix I came up with. I'm not sure if its a good fix or not. http://jsfiddle.net/g4M4t/6/

Working example http://jsfiddle.net/N8Pmc/2/

overflow:hidden is not allowed to have scroll bar, so it's not scroll parent. I'm inclined to advise you to change the height dynamically.

It wasn't the height I needed but the width and changing the width did not fit my needs for the project I was working on. I don't want a scroll bar but the scroll-ability. I couldn't get the desired effect with changing the width. If you have a better idea I'd love to hear it.

This is what I was doing when I found this IE issue that this topic is about (still in development) http://jsfiddle.net/rbb4X/ (the one with the IE Issue)

Click and drag the tab to the side makes the other tabs scroll so you can sort across all of the tabs works in firefox chrome and safari but not IE. Also if I didn't extend the the scroll parent to use hidden the it would only work if it had a scroll bar, and in everything but IE. Removing the if statement in the scroll parent function where it test for IE and just used the part in the else fixed it in IE 9. Now I'm not sure it the IE test was there for an older version of IE or not I don't have an older version of IE to test with.

With the dragging I couldn't see a way the default scroll in the draggable widget would work when you have a case when you do not want a scroll bar (overflow:hidden).

Doing what you suggested would seem like your suggesting to extend another widget to do a functional aspect that I can see being useful in many ways that basically already exists in another form but not supported. I don't see how an overflow of hidden would not be considered a scrollParent just because i dose not use a scrollbar even though it dose have the capabilities of scrolling.

I could extend the draggable widget to do what i need it to do but extending the scrollParent function was the fastest least hacky was to do it

Last edited 7 years ago by ScottGaines (previous) (diff)

comment:7 Changed 5 years ago by mikesherov

Milestone: none1.10.4
Resolution: fixed
Status: openclosed
Summary: scrollParent not working properly in IECore: scrollParent not working properly in IE for static or relative elements
Note: See TracTickets for help on using tickets.