tweak proxy tag editing

This commit is contained in:
Spectralitree 2021-01-13 16:23:46 +01:00
parent d3b9d6bfd3
commit 10b6fca660
3 changed files with 14 additions and 11 deletions

View File

@ -65,7 +65,7 @@ export default function MemberCard(props) {
} = useForm(); } = useForm();
useEffect(() => { useEffect(() => {
autosize(document.querySelector('textarea')); autosize(document.querySelectorAll('textarea'));
}) })
useEffect(() => { useEffect(() => {
@ -384,16 +384,16 @@ export default function MemberCard(props) {
<BS.Form onSubmit={handleSubmitProxy(submitProxy)}> <BS.Form onSubmit={handleSubmitProxy(submitProxy)}>
<BS.Form.Row> <BS.Form.Row>
{ proxyTags.map((item, index) => ( { proxyTags.map((item, index) => (
<BS.Col key={index} className="mb-lg-2" xs={12} lg={2}> <BS.Col key={index} className="mb-lg-2" xs={12} lg={3}>
<BS.Form.Row> <BS.Form.Row>
<BS.InputGroup className="ml-1 mr-1 mb-1"> <BS.InputGroup className="ml-1 mr-1 mb-1">
<BS.Form.Control name={`proxy_tags[${index}].prefix`} defaultValue={item.prefix} ref={registerProxy}/> <BS.Form.Control as="textarea" rows="1" name={`proxy_tags[${index}].prefix`} defaultValue={item.prefix} ref={registerProxy}/>
<BS.Form.Control disabled placeholder='text'/> <BS.Form.Control as="textarea" rows="1" disabled placeholder='text'/>
<BS.Form.Control name={`proxy_tags[${index}].suffix`} defaultValue={item.suffix} ref={registerProxy}/> <BS.Form.Control as="textarea" rows="1" name={`proxy_tags[${index}].suffix`} defaultValue={item.suffix} ref={registerProxy}/>
</BS.InputGroup> </BS.InputGroup>
</BS.Form.Row> </BS.Form.Row>
</BS.Col> </BS.Col>
))} <BS.Col className="mb-2" xs={12} lg={2}><BS.Button block variant="light" onClick={() => addProxyField()}>Add new</BS.Button></BS.Col> ))} <BS.Col className="mb-2" xs={12} lg={3}><BS.Button block variant="light" onClick={() => addProxyField()}>Add new</BS.Button></BS.Col>
</BS.Form.Row> </BS.Form.Row>
<BS.Button variant="light" onClick={() => resetProxyFields()}>Exit</BS.Button> <BS.Button variant="primary" type="submit">Submit</BS.Button> <BS.Button variant="light" onClick={() => resetProxyFields()}>Exit</BS.Button> <BS.Button variant="primary" type="submit">Submit</BS.Button>
</BS.Form><hr/></> : proxyView ? </BS.Form><hr/></> : proxyView ?

View File

@ -65,7 +65,7 @@ export default function MemberPage(props) {
} = useForm(); } = useForm();
useEffect(() => { useEffect(() => {
autosize(document.querySelector('textarea')); autosize(document.querySelectorAll('textarea'));
}) })
useEffect(() => { useEffect(() => {
@ -389,13 +389,13 @@ export default function MemberPage(props) {
<BS.Col key={index} className="mb-lg-2" xs={12} lg={2}> <BS.Col key={index} className="mb-lg-2" xs={12} lg={2}>
<BS.Form.Row> <BS.Form.Row>
<BS.InputGroup className="ml-1 mr-1 mb-1"> <BS.InputGroup className="ml-1 mr-1 mb-1">
<BS.Form.Control name={`proxy_tags[${index}].prefix`} defaultValue={item.prefix} ref={registerProxy}/> <BS.Form.Control as="textarea" rows="1" name={`proxy_tags[${index}].prefix`} defaultValue={item.prefix} ref={registerProxy}/>
<BS.Form.Control disabled placeholder='text'/> <BS.Form.Control as="textarea" rows="1" disabled placeholder='text'/>
<BS.Form.Control name={`proxy_tags[${index}].suffix`} defaultValue={item.suffix} ref={registerProxy}/> <BS.Form.Control as="textarea" rows="1" name={`proxy_tags[${index}].suffix`} defaultValue={item.suffix} ref={registerProxy}/>
</BS.InputGroup> </BS.InputGroup>
</BS.Form.Row> </BS.Form.Row>
</BS.Col> </BS.Col>
))} <BS.Col className="mb-2" xs={12} lg={2}><BS.Button block variant="light" onClick={() => addProxyField()}>Add new</BS.Button></BS.Col> ))} <BS.Col className="mb-2" xs={12} lg={3}><BS.Button block variant="light" onClick={() => addProxyField()}>Add new</BS.Button></BS.Col>
</BS.Form.Row> </BS.Form.Row>
<BS.Button variant="light" onClick={() => resetProxyFields()}>Exit</BS.Button> <BS.Button variant="primary" type="submit">Submit</BS.Button> <BS.Button variant="light" onClick={() => resetProxyFields()}>Exit</BS.Button> <BS.Button variant="primary" type="submit">Submit</BS.Button>
</BS.Form><hr/></> : proxyView ? </BS.Form><hr/></> : proxyView ?

View File

@ -320,4 +320,7 @@ blockquote {
background: linear-gradient(to bottom, rgba(52, 58, 64, 1) 0%, rgba(52, 58, 64, 0) 100%); background: linear-gradient(to bottom, rgba(52, 58, 64, 1) 0%, rgba(52, 58, 64, 0) 100%);
} }
textarea {
resize: none !important;
}
@import "~bootstrap/scss/bootstrap"; @import "~bootstrap/scss/bootstrap";