From 2e94227675d9e95d48ab11c46b572e80b89c3d16 Mon Sep 17 00:00:00 2001 From: Brandy Carney Date: Mon, 20 Aug 2018 11:35:48 -0400 Subject: [PATCH] fix(img): add object-fit to the host to avoid skewing the inner img --- core/src/components/img/img.scss | 2 + core/src/components/img/test/basic/index.html | 2 +- .../src/components/img/test/standalone/e2e.js | 19 +++++ .../components/img/test/standalone/index.html | 76 +++++++++++++++++++ 4 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 core/src/components/img/test/standalone/e2e.js create mode 100644 core/src/components/img/test/standalone/index.html diff --git a/core/src/components/img/img.scss b/core/src/components/img/img.scss index e9c13b84dc..ca972b638e 100644 --- a/core/src/components/img/img.scss +++ b/core/src/components/img/img.scss @@ -1,6 +1,8 @@ :host { display: block; + + object-fit: contain; } img { diff --git a/core/src/components/img/test/basic/index.html b/core/src/components/img/test/basic/index.html index a20f57d4f8..d56bc05efd 100644 --- a/core/src/components/img/test/basic/index.html +++ b/core/src/components/img/test/basic/index.html @@ -3,7 +3,7 @@ - Floating Action Button - Basic + Img - Basic diff --git a/core/src/components/img/test/standalone/e2e.js b/core/src/components/img/test/standalone/e2e.js new file mode 100644 index 0000000000..82d981a7f1 --- /dev/null +++ b/core/src/components/img/test/standalone/e2e.js @@ -0,0 +1,19 @@ +'use strict'; + +const { By, until } = require('selenium-webdriver'); +const { register, Page, platforms } = require('../../../../../scripts/e2e'); + +class E2ETestPage extends Page { + constructor(driver, platform) { + super(driver, `http://localhost:3333/src/components/fab/test/basic?ionic:mode=${platform}`); + } +} + +platforms.forEach(platform => { + describe('fab/basic', () => { + register('should init', driver => { + const page = new E2ETestPage(driver, platform); + return page.navigate('#content'); + }); + }); +}); diff --git a/core/src/components/img/test/standalone/index.html b/core/src/components/img/test/standalone/index.html new file mode 100644 index 0000000000..4e2e8c1239 --- /dev/null +++ b/core/src/components/img/test/standalone/index.html @@ -0,0 +1,76 @@ + + + + + + Img - Standalone + + + + + + +

Default

+ + +

Custom Width

+ + +

Custom Height

+ + +

Custom Height / Fit

+ + +

Grid of Images

+ + + + + + + +