mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): fix readonly inputs (#3689)
There was a props on IAISlider to make the input component readonly - I didn't know this existed and at some point used a component with that prop as a template for other sliders, copying the flag over. It's not actually used anywhere, so I removed the prop entirely, enabling the number inputs everywhere.
This commit is contained in:
commit
018cd00b2f
@ -56,7 +56,6 @@ export type IAIFullSliderProps = {
|
|||||||
withInput?: boolean;
|
withInput?: boolean;
|
||||||
isInteger?: boolean;
|
isInteger?: boolean;
|
||||||
inputWidth?: string | number;
|
inputWidth?: string | number;
|
||||||
inputReadOnly?: boolean;
|
|
||||||
withReset?: boolean;
|
withReset?: boolean;
|
||||||
handleReset?: () => void;
|
handleReset?: () => void;
|
||||||
tooltipSuffix?: string;
|
tooltipSuffix?: string;
|
||||||
@ -90,7 +89,6 @@ const IAISlider = (props: IAIFullSliderProps) => {
|
|||||||
withInput = false,
|
withInput = false,
|
||||||
isInteger = false,
|
isInteger = false,
|
||||||
inputWidth = 16,
|
inputWidth = 16,
|
||||||
inputReadOnly = false,
|
|
||||||
withReset = false,
|
withReset = false,
|
||||||
hideTooltip = false,
|
hideTooltip = false,
|
||||||
isCompact = false,
|
isCompact = false,
|
||||||
@ -152,6 +150,7 @@ const IAISlider = (props: IAIFullSliderProps) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const handleInputChange = useCallback((v: number | string) => {
|
const handleInputChange = useCallback((v: number | string) => {
|
||||||
|
console.log('input');
|
||||||
setLocalInputValue(v);
|
setLocalInputValue(v);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@ -311,7 +310,6 @@ const IAISlider = (props: IAIFullSliderProps) => {
|
|||||||
{...sliderNumberInputProps}
|
{...sliderNumberInputProps}
|
||||||
>
|
>
|
||||||
<NumberInputField
|
<NumberInputField
|
||||||
readOnly={inputReadOnly}
|
|
||||||
minWidth={inputWidth}
|
minWidth={inputWidth}
|
||||||
{...sliderNumberInputFieldProps}
|
{...sliderNumberInputFieldProps}
|
||||||
/>
|
/>
|
||||||
|
@ -235,7 +235,6 @@ const IAICanvasToolChooserOptions = () => {
|
|||||||
withInput
|
withInput
|
||||||
onChange={(newSize) => dispatch(setBrushSize(newSize))}
|
onChange={(newSize) => dispatch(setBrushSize(newSize))}
|
||||||
sliderNumberInputProps={{ max: 500 }}
|
sliderNumberInputProps={{ max: 500 }}
|
||||||
inputReadOnly={false}
|
|
||||||
/>
|
/>
|
||||||
</Flex>
|
</Flex>
|
||||||
<IAIColorPicker
|
<IAIColorPicker
|
||||||
|
@ -51,7 +51,6 @@ const ParamDynamicPromptsMaxPrompts = () => {
|
|||||||
sliderNumberInputProps={{ max: inputMax }}
|
sliderNumberInputProps={{ max: inputMax }}
|
||||||
withSliderMarks
|
withSliderMarks
|
||||||
withInput
|
withInput
|
||||||
inputReadOnly
|
|
||||||
withReset
|
withReset
|
||||||
handleReset={handleReset}
|
handleReset={handleReset}
|
||||||
/>
|
/>
|
||||||
|
@ -59,7 +59,6 @@ const ParamBoundingBoxWidth = () => {
|
|||||||
sliderNumberInputProps={{ max: 4096 }}
|
sliderNumberInputProps={{ max: 4096 }}
|
||||||
withSliderMarks
|
withSliderMarks
|
||||||
withInput
|
withInput
|
||||||
inputReadOnly
|
|
||||||
withReset
|
withReset
|
||||||
handleReset={handleResetHeight}
|
handleReset={handleResetHeight}
|
||||||
/>
|
/>
|
||||||
|
@ -59,7 +59,6 @@ const ParamBoundingBoxWidth = () => {
|
|||||||
sliderNumberInputProps={{ max: 4096 }}
|
sliderNumberInputProps={{ max: 4096 }}
|
||||||
withSliderMarks
|
withSliderMarks
|
||||||
withInput
|
withInput
|
||||||
inputReadOnly
|
|
||||||
withReset
|
withReset
|
||||||
handleReset={handleResetWidth}
|
handleReset={handleResetWidth}
|
||||||
/>
|
/>
|
||||||
|
@ -58,7 +58,6 @@ const ParamScaledHeight = () => {
|
|||||||
sliderNumberInputProps={{ max: 4096 }}
|
sliderNumberInputProps={{ max: 4096 }}
|
||||||
withSliderMarks
|
withSliderMarks
|
||||||
withInput
|
withInput
|
||||||
inputReadOnly
|
|
||||||
withReset
|
withReset
|
||||||
handleReset={handleResetScaledHeight}
|
handleReset={handleResetScaledHeight}
|
||||||
/>
|
/>
|
||||||
|
@ -56,7 +56,6 @@ const ParamScaledWidth = () => {
|
|||||||
sliderNumberInputProps={{ max: 4096 }}
|
sliderNumberInputProps={{ max: 4096 }}
|
||||||
withSliderMarks
|
withSliderMarks
|
||||||
withInput
|
withInput
|
||||||
inputReadOnly
|
|
||||||
withReset
|
withReset
|
||||||
handleReset={handleResetScaledWidth}
|
handleReset={handleResetScaledWidth}
|
||||||
/>
|
/>
|
||||||
|
@ -48,7 +48,6 @@ export default function UnifiedCanvasBrushSize() {
|
|||||||
withInput
|
withInput
|
||||||
onChange={(newSize) => dispatch(setBrushSize(newSize))}
|
onChange={(newSize) => dispatch(setBrushSize(newSize))}
|
||||||
sliderNumberInputProps={{ max: 500 }}
|
sliderNumberInputProps={{ max: 500 }}
|
||||||
inputReadOnly={false}
|
|
||||||
isCompact
|
isCompact
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user