From deba1e438f4032fb8d517298d30c569176e1665d Mon Sep 17 00:00:00 2001 From: Pavel Dohnal Date: Mon, 20 Apr 2020 14:54:53 +0200 Subject: [PATCH] Display inputs with padding [MAILPOET-2809] --- .../js/src/form_editor/blocks/custom_select/edit.jsx | 12 +++++++++++- .../src/form_editor/blocks/custom_textarea/edit.jsx | 8 ++++++++ assets/js/src/form_editor/blocks/submit/edit.jsx | 10 ++++++++++ assets/js/src/form_editor/blocks/text_input_edit.jsx | 9 +++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/assets/js/src/form_editor/blocks/custom_select/edit.jsx b/assets/js/src/form_editor/blocks/custom_select/edit.jsx index aa7cb42457..4f543cda27 100644 --- a/assets/js/src/form_editor/blocks/custom_select/edit.jsx +++ b/assets/js/src/form_editor/blocks/custom_select/edit.jsx @@ -16,6 +16,10 @@ import CustomFieldSettings from '../custom_radio/custom_field_settings.jsx'; import mapCustomFieldFormData from '../map_custom_field_form_data.jsx'; const CustomSelectEdit = ({ attributes, setAttributes, clientId }) => { + const settings = useSelect( + (select) => select('mailpoet-form-editor').getFormSettings(), + [] + ); const isSaving = useSelect( (sel) => sel('mailpoet-form-editor').getIsCustomFieldSaving(), [] @@ -92,8 +96,14 @@ const CustomSelectEdit = ({ attributes, setAttributes, clientId }) => { }); } + const inputStyles = {}; + + if (settings.inputPadding !== undefined) { + inputStyles.padding = settings.inputPadding; + } + return ( - { options.map((option, index) => (