File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ export const Form: React.FC<FormProps> = props => {
6767 setFocusedElement ( ( focusedElement ) => focusedElement - 1 ) ;
6868 focusManager . focusPrevious ( ) ;
6969 } else if ( key . downArrow ) {
70- if ( focusedElement + 1 > sections [ currentTab ] . fields . length + 2 ) {
70+ if ( focusedElement + 1 > sections [ currentTab ] . fields . length + 2 + ( canSubmitForm ? 1 : 0 ) ) {
7171 return ;
7272 }
7373
@@ -127,10 +127,14 @@ export const Form: React.FC<FormProps> = props => {
127127 < DescriptionRenderer description = { props . form . sections [ currentTab ] ?. description } />
128128 </ Box >
129129 ) }
130- < Box marginLeft = { 1 } marginTop = { 1 } >
131- < Text bold > { sections [ currentTab ] . title } </ Text >
132- </ Box >
133- < Text > { ' {' } </ Text >
130+ { ! editingField && (
131+ < Box flexDirection = 'column' >
132+ < Box marginLeft = { 1 } marginTop = { 1 } >
133+ < Text bold > { sections [ currentTab ] . title } </ Text >
134+ </ Box >
135+ < Text > { ' {' } </ Text >
136+ </ Box >
137+ ) }
134138 < Box flexDirection = "column" >
135139 { currentTab > props . form . sections . length - 1
136140 ? null
@@ -147,7 +151,9 @@ export const Form: React.FC<FormProps> = props => {
147151 customManagers = { props . customManagers }
148152 />
149153 ) ) }
150- < Text > { ' }' } </ Text >
154+ { ! editingField && (
155+ < Text > { ' }' } </ Text >
156+ ) }
151157 < Box flexDirection = "row-reverse" >
152158 < Button label = "Add Item (duplicate)" onClicked = { ( ) => duplicateCurrentItem ( ) } />
153159 </ Box >
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export const SubmitButton: React.FC<{
2323 : 'Use the arrow keys to navigate to the submit button.' }
2424 </ Text >
2525 </ Box >
26- < Box borderStyle = { 'round' } borderColor = { ! props . canSubmit ? 'gray' : isFocused ? 'blue' : 'white ' } paddingX = { 2 } >
26+ < Box borderStyle = { 'round' } borderColor = { ! props . canSubmit ? 'gray' : isFocused ? 'blue' : 'green ' } paddingX = { 2 } >
2727 < Text color = { ! props . canSubmit ? 'gray' : isFocused ? 'blue' : 'white' } bold = { true } underline = { isFocused } >
2828 { props . canSubmit ? 'Submit form' : 'Cannot submit form yet' }
2929 </ Text >
You can’t perform that action at this time.
0 commit comments