Skip to content
Permalink
Browse files

fix(item): align stacked and floating items start (#18379)

fixes #16375
  • Loading branch information...
brandyscarney committed May 24, 2019
1 parent 292b24a commit f0af70736be48f39ba11b9e92592b63139f94bf1
@@ -30,6 +30,10 @@
<ion-label position="stacked">Stacked: input value</ion-label>
<ion-input value="value"></ion-input>
</ion-item>
<ion-item>
<ion-label position="stacked">Stacked: div</ion-label>
<div>A div</div>
</ion-item>
<ion-item>
<ion-label position="floating">Floating: textarea</ion-label>
<ion-textarea></ion-textarea>
@@ -8,14 +8,36 @@ export async function openItemSliding(id: string, page: any, rtl = false) {
const centerX = parseFloat(boundingBox.x + boundingBox.width / 2);
const centerY = parseFloat(boundingBox.y + boundingBox.height / 2);

// In LTR start the drag at the center, move halfway in between the
// center and 0, then end at 0
//
// 0 boundingBox.width
// |---------|---------|---------|---------|
// endX halfX centerX

let halfX = centerX / 2;
let endX = 0;

// In RTL start at the center, move halfway in between the center and
// the total width, then end at the total width
//
// 0 boundingBox.width
// |---------|---------|---------|---------|
// centerX halfX endX

if (rtl) {
halfX = centerX + (centerX / 2);
endX = boundingBox.width;
}

// Start in the center of the item
await page.mouse.move(centerX, centerY);
await page.mouse.down();
await page.mouse.move(centerX / 2, centerY);

// Move halfway first
await page.mouse.move(halfX, centerY);

// Move all of the way to the end
await page.mouse.move(endX, centerY);
await page.mouse.up();

@@ -255,6 +255,11 @@ button, a {
box-sizing: border-box;
}

:host(.item-label-stacked) .item-native,
:host(.item-label-floating) .item-native {
align-items: start;
}

:host(.item-label-stacked) .input-wrapper,
:host(.item-label-floating) .input-wrapper {
flex: 1;

0 comments on commit f0af707

Please sign in to comment.
You can’t perform that action at this time.