Skip to content

Commit

Permalink
Merge pull request #681 from openkraken/fix/single-overflow-fail
Browse files Browse the repository at this point in the history
fix: scroll not working when overflowY is set to auto/scroll and overflowX not set
  • Loading branch information
andycall committed Sep 13, 2021
2 parents c251c85 + 95fc2cf commit 4d4738a
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
47 changes: 46 additions & 1 deletion integration_tests/specs/css/css-box/overflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,4 +366,49 @@ describe('Overflow', () => {

expect(clickCount).toBe(2);
});
});

// @TODO simulateSwipe method fails to trigger element scroll.
// https://github.com/openkraken/kraken/issues/680
xit('scroll works with overflowY set to auto and overflowX not set', async (done) => {
let div;
div = createElement(
'div',
{
style: {
width: '200px',
height: '200px',
overflowY: 'auto',
},
}, [
createElement(
'div',
{
style: {
width: '200px',
height: '200px',
backgroundColor: 'green',

},
}),
createElement(
'div',
{
style: {
width: '200px',
height: '200px',
backgroundColor: 'yellow',

},
}),
],
);
BODY.appendChild(div);
await snapshot();
await simulateSwipe(50, 100, 50, 20, 0.1);

setTimeout(async () => {
await snapshot();
done();
}, 200);
});
});
1 change: 1 addition & 0 deletions kraken/lib/src/rendering/box_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,7 @@ class RenderBoxModel extends RenderBox

// Copy overflow
..scrollListener = scrollListener
..pointerListener = pointerListener
..clipX = clipX
..clipY = clipY
..enableScrollX = enableScrollX
Expand Down

0 comments on commit 4d4738a

Please sign in to comment.