Fix form date time field right border when variable picker is provided and field is readonly (#9600)

This commit is contained in:
Baptiste Devessier
2025-01-14 13:58:52 +01:00
committed by GitHub
parent f151963e66
commit 4719fe6ed9
3 changed files with 23 additions and 1 deletions

View File

@ -333,7 +333,7 @@ export const FormDateTimeFieldInput = ({
<FormFieldInputRowContainer>
<StyledInputContainer
ref={datePickerWrapperRef}
hasRightElement={isDefined(VariablePicker)}
hasRightElement={isDefined(VariablePicker) && !readonly}
>
{draftValue.type === 'static' ? (
<>

View File

@ -396,6 +396,17 @@ export const DisabledWithVariable: Story = {
defaultValue: `{{a.b.c}}`,
onPersist: fn(),
readonly: true,
VariablePicker: ({ onVariableSelect }) => {
return (
<button
onClick={() => {
onVariableSelect('{{test}}');
}}
>
Add variable
</button>
);
},
},
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);

View File

@ -427,6 +427,17 @@ export const DisabledWithVariable: Story = {
defaultValue: `{{a.b.c}}`,
onPersist: fn(),
readonly: true,
VariablePicker: ({ onVariableSelect }) => {
return (
<button
onClick={() => {
onVariableSelect('{{test}}');
}}
>
Add variable
</button>
);
},
},
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);