From fa1343e8af3562022fbf1ea2eead11c5a7bf2009 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Thu, 24 Nov 2016 17:17:08 +0100 Subject: [PATCH] align copy button to input field --- js/src/ui/Form/Input/input.css | 2 +- js/src/ui/Form/Input/input.js | 22 ++-------------------- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/js/src/ui/Form/Input/input.css b/js/src/ui/Form/Input/input.css index bc7cfb840..b4d535eb9 100644 --- a/js/src/ui/Form/Input/input.css +++ b/js/src/ui/Form/Input/input.css @@ -18,7 +18,7 @@ .container { display: flex; flex-direction: row; - align-items: flex-end; + align-items: baseline; position: relative; } diff --git a/js/src/ui/Form/Input/input.js b/js/src/ui/Form/Input/input.js index 4dee227c6..e48ab63ff 100644 --- a/js/src/ui/Form/Input/input.js +++ b/js/src/ui/Form/Input/input.js @@ -144,35 +144,17 @@ export default class Input extends Component { } renderCopyButton () { - const { allowCopy, label, hint, floatCopy } = this.props; + const { allowCopy, hideUnderline } = this.props; const { value } = this.state; if (!allowCopy) { return null; } - - const style = { - marginBottom: 13 - }; - const text = typeof allowCopy === 'string' ? allowCopy : value; - if (!label) { - style.marginBottom = 2; - } else if (label && !hint) { - style.marginBottom = 4; - } else if (label && hint) { - style.marginBottom = 10; - } - - if (floatCopy) { - style.position = 'absolute'; - style.left = -24; - style.bottom = style.marginBottom; - style.marginBottom = 0; - } + const style = hideUnderline ? {} : { position: 'relative', top: '2px' }; return (