Page 1 of 1

fit data in dialog

Posted: 01 Jul 2022, 09:58
by sancelot
Hi,

a am a newbie
I would like a form to fit in a dialog.

I don't understand how to fit it :

Code: Select all

 <div className='my-dialog'>
            <Dialog
                footer={renderFooter('displayBasic')}
                header='Pickup Dialog'
                modal={false}
                onHide={() => onHide('displayBasic')}
                style={{ width: '10vw' }}
                visible={visible}
            >
                <div className='p-fluid grid formgrid'>
                    <div className={styles.card}>
                        <div className={styles.field}>
                            <div className='field col-12 md:col-3'>
                                <label htmlFor='integeronly'>Part chunk</label>
                                <InputNumber
                                    inputId='integeronly'
                                    onFocus={(e) => e.target.select()}
                                    onValueChange={(e) => {
                                        if (e.value) setTronconValue(e.value);
                                    }}
                                    value={Troncon}
                                />
                            </div>
                        </div>
                        <div className={styles.field}>
                            <div className='field col-12 md:col-3'>
                                <label htmlFor='distance'>Distance 1</label>
                                <InputNumber
                                    inputId='distance'
                                    minFractionDigits={1}
                                    mode='decimal'
                                    onFocus={(e) => e.target.select()}
                                    onValueChange={(e) => {
                                        if (e.value) setDistanceValue(e.value);
                                    }}
                                    value={Distance}
                                />
                            </div>
                        </div>
                        <div className={styles.field}>
                            <div className='field col-12 md:col-3'>
                                <label htmlFor='orientationpince'>Distance 2</label>
                                <InputNumber
                                    inputId='orientationpince'
                                    minFractionDigits={1}
                                    mode='decimal'
                                    onFocus={(e) => e.target.select()}
                                    onValueChange={(e) => {
                                        if (e.value) setOrientationValue(e.value);
                                    }}
                                    value={Orientation}
                                />
                            </div>
                        </div>
                        <div className={styles.field}>
                            <div className='field-checkbox'>
                                <Checkbox
                                    checked={FlipPince}
                                    inputId='flippince'
                                    onChange={(e) => setFlipPinceValue(e.checked)}
                                />
                                <label htmlFor='flippince'>&nbsp;Check or not</label>
                            </div>
                        </div>
                    </div>
                </div>
            </Dialog>
        </div>

Re: fit data in dialog

Posted: 04 Jul 2022, 14:31
by Melloware
You are saying your dialog only has 10vw with "style={{ width: '10vw' }}" you might have to set the same on you div inside the dialog...

<div className='p-fluid grid formgrid' "style={{ width: '10vw' }}>