mirror of
https://github.com/jlengrand/adyen-web.git
synced 2026-03-10 08:01:22 +00:00
fix: remove inline style applied to iframe (#2343)
This commit is contained in:
5
.changeset/dirty-bugs-rush.md
Normal file
5
.changeset/dirty-bugs-rush.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@adyen/adyen-web": patch
|
||||
---
|
||||
|
||||
fix: remove inline style applied to iframe
|
||||
3
packages/lib/src/components/internal/IFrame/Iframe.scss
Normal file
3
packages/lib/src/components/internal/IFrame/Iframe.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
.adyen-checkout__iframe{
|
||||
border: 0;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Component, h } from 'preact';
|
||||
import classNames from 'classnames';
|
||||
import './Iframe.scss';
|
||||
|
||||
interface IframeProps {
|
||||
width?: string;
|
||||
@@ -75,7 +76,6 @@ class Iframe extends Component<IframeProps> {
|
||||
src={src}
|
||||
width={width}
|
||||
height={height}
|
||||
style={{ border: 0 }}
|
||||
frameBorder="0"
|
||||
title={title}
|
||||
/* eslint-disable react/no-unknown-property */
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
.js-iframe {
|
||||
border: none;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
@@ -28,6 +28,7 @@ import { processAriaConfig } from './utils/processAriaConfig';
|
||||
import { processPlaceholders } from './utils/processPlaceholders';
|
||||
import Language from '../../../../../language/Language';
|
||||
import { hasOwnProperty } from '../../../../../utils/hasOwnProperty';
|
||||
import './SecuredField.scss';
|
||||
|
||||
const logPostMsg = false;
|
||||
const doLog = false;
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
export default function createIframe({
|
||||
src,
|
||||
title = 'iframe element',
|
||||
policy = 'origin',
|
||||
styleStr = 'border: none; height:100%; width:100%; overflow:hidden;'
|
||||
}) {
|
||||
export default function createIframe({ src, title = 'iframe element', policy = 'origin' }) {
|
||||
const iframeEl = document.createElement('iframe');
|
||||
iframeEl.setAttribute('src', src);
|
||||
iframeEl.setAttribute('class', 'js-iframe');
|
||||
iframeEl.classList.add('js-iframe');
|
||||
// For a11y some merchants want to be able to remove the title element on the iframe - seeing the info it carries as extraneous for the screenreader
|
||||
if (title === '' || title.trim().length === 0 || title === 'none') {
|
||||
iframeEl.setAttribute('role', 'presentation');
|
||||
@@ -15,7 +10,6 @@ export default function createIframe({
|
||||
}
|
||||
|
||||
iframeEl.setAttribute('allowtransparency', 'true');
|
||||
iframeEl.setAttribute('style', styleStr);
|
||||
iframeEl.setAttribute('referrerpolicy', policy); // Necessary for ClientKey to work
|
||||
// Commenting out stops the "The devicemotion events are blocked by feature policy" warning in Chrome >=66 that some merchant experienced
|
||||
// Commenting in stops the same warnings in development (??)
|
||||
|
||||
Reference in New Issue
Block a user