Skip to content

Commit

Permalink
Fix focus jumps at end of input field
Browse files Browse the repository at this point in the history
  • Loading branch information
ivy-lli committed Dec 10, 2024
1 parent ade351b commit a0856a1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/editor/src/editor/sidebar/fields/InputField.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BasicField, Input, type MessageData } from '@axonivy/ui-components';
import { BasicField, BasicInput, type MessageData } from '@axonivy/ui-components';
import type { TextFieldOptions } from '../../../types/config';

export type InputFieldProps = {
Expand All @@ -11,7 +11,7 @@ export type InputFieldProps = {

export const InputField = ({ label, value, onChange, onBlur, message, options }: InputFieldProps & { options?: TextFieldOptions }) => (
<BasicField label={label} message={message} className='badge-field' tabIndex={0}>
<Input
<BasicInput
value={value}
onChange={e => onChange(e.target.value)}
onBlur={onBlur}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BasicField, Button, Dialog, DialogContent, DialogTrigger, Input, InputBadge, InputGroup } from '@axonivy/ui-components';
import { BasicField, BasicInput, Button, Dialog, DialogContent, DialogTrigger, InputBadge, InputGroup } from '@axonivy/ui-components';
import { IvyIcons } from '@axonivy/ui-icons';
import { useRef, useState } from 'react';
import type { InputFieldProps } from './InputField';
Expand Down Expand Up @@ -30,7 +30,7 @@ export const InputFieldWithBrowser = ({
<BasicField label={label} message={message} style={{ flex: '1' }} {...focusWithinProps} className='badge-field' tabIndex={0}>
{isFocusWithin || cmsQuickFixPopoverRef.current ? (
<InputGroup>
<Input
<BasicInput
ref={inputRef}
value={value}
onChange={e => onChange(e.target.value)}
Expand Down
4 changes: 2 additions & 2 deletions packages/editor/src/editor/sidebar/fields/NumberField.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Input, BasicField, type MessageData } from '@axonivy/ui-components';
import { BasicField, type MessageData, BasicInput } from '@axonivy/ui-components';

type InputFieldProps = {
label: string;
Expand All @@ -9,6 +9,6 @@ type InputFieldProps = {

export const NumberField = ({ label, value, onChange, message }: InputFieldProps) => (
<BasicField label={label} message={message}>
<Input type='number' value={value} onChange={e => onChange(Number(e.target.value))} />
<BasicInput type='number' value={value} onChange={e => onChange(Number(e.target.value))} />
</BasicField>
);

0 comments on commit a0856a1

Please sign in to comment.