You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@answer.apache.org by "Dinesht04 (via GitHub)" <gi...@apache.org> on 2025/11/12 20:58:44 UTC
[PR] feat(ui): add min values for inputs and context-based keyboards for inputs (for touch systems) [answer]
Dinesht04 opened a new pull request, #1424:
URL: https://github.com/apache/answer/pull/1424
fix: #1417
Added Property MinValue in Input Component (Default = 0) and Property InputMode (Default = 'text'). Used in making the form for Admin -> Priviliges.
Added InputMode types in InputOptions
Added min = {0} property and inputMode = 'numeric' property to all the numeric type inputs in Admin -> Write.
InputMode hints at the type of data that might be entered by the user while editing the element or its contents. This allows for a numeric keyboard in Touch Mode.
Source for input mode types - https://html.spec.whatwg.org/multipage/interaction.html#attr-inputmode
Didn't add any Default Max values since I think it is subjective and based on user's choice and I couldn't decide an upper limit.
Open to Suggestions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org
Re: [PR] feat(ui): add min|max values for inputs and context-based keyboards for inputs (for touch systems) [answer]
Posted by "Dinesht04 (via GitHub)" <gi...@apache.org>.
Dinesht04 commented on code in PR #1424:
URL: https://github.com/apache/answer/pull/1424#discussion_r2541313760
##########
ui/src/components/SchemaForm/components/Input.tsx:
##########
@@ -60,6 +75,9 @@ const Index: FC<Props> = ({
placeholder={placeholder}
type={type}
value={fieldObject?.value || ''}
+ min={min}
+ max={max}
+ inputMode={inputMode}
Review Comment:
I didn't even know you could conditionally pass props in this manner. Thank you so much. I agree with the max value point.
Could please guide me whether I should combine all the changes into a single commit or is it okay if I have multiple commits, I am unaware of what's the best practice. Thank you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org
Re: [PR] feat(ui): add min values for inputs and context-based keyboards for inputs (for touch systems) [answer]
Posted by "shuashuai (via GitHub)" <gi...@apache.org>.
shuashuai commented on code in PR #1424:
URL: https://github.com/apache/answer/pull/1424#discussion_r2521989613
##########
ui/src/components/SchemaForm/components/Input.tsx:
##########
@@ -29,6 +29,17 @@ interface Props {
onChange?: (fd: Type.FormDataType) => void;
formData: Type.FormDataType;
readOnly: boolean;
+ minValue?: number;
+ inputMode?:
+ | 'text'
+ | 'search'
+ | 'none'
+ | 'tel'
+ | 'url'
+ | 'email'
+ | 'numeric'
+ | 'decimal'
+ | undefined;
}
Review Comment:
1. Just added the relevant TypeScript types inside the input component.
2. Missing relevant TypeScript definitions in SchemaForm(`/ui/src/components/SchemaForm/types.ts`), So there will be a TypeScript error when generating forms through configuration. You can conduct relevant tests in `ui/src/pages/Admin/Smtp/index.tsx`
eg:
<img width="583" height="481" alt="image" src="https://github.com/user-attachments/assets/1fe2efd3-8856-4363-a5e5-dd243bcb0e8e" />
3. According to the requirement description, it is also necessary to support the max attribute.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org
Re: [PR] feat(ui): add min|max values for inputs and context-based keyboards for inputs (for touch systems) [answer]
Posted by "shuashuai (via GitHub)" <gi...@apache.org>.
shuashuai commented on code in PR #1424:
URL: https://github.com/apache/answer/pull/1424#discussion_r2525524956
##########
ui/src/components/SchemaForm/components/Input.tsx:
##########
@@ -60,6 +75,9 @@ const Index: FC<Props> = ({
placeholder={placeholder}
type={type}
value={fieldObject?.value || ''}
+ min={min}
+ max={max}
+ inputMode={inputMode}
Review Comment:
min and max should only be added when the type of input is number, And the default value of max should not be a fixed value. I think it would be better to do this
eg:
<img width="889" height="605" alt="image" src="https://github.com/user-attachments/assets/2cd6a3e5-4081-4fd9-a702-af9e786eea92" />
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org
Re: [PR] feat(ui): add min|max values for inputs and context-based keyboards for inputs (for touch systems) [answer]
Posted by "Dinesht04 (via GitHub)" <gi...@apache.org>.
Dinesht04 commented on code in PR #1424:
URL: https://github.com/apache/answer/pull/1424#discussion_r2524925591
##########
ui/src/components/SchemaForm/components/Input.tsx:
##########
@@ -29,6 +29,17 @@ interface Props {
onChange?: (fd: Type.FormDataType) => void;
formData: Type.FormDataType;
readOnly: boolean;
+ minValue?: number;
+ inputMode?:
+ | 'text'
+ | 'search'
+ | 'none'
+ | 'tel'
+ | 'url'
+ | 'email'
+ | 'numeric'
+ | 'decimal'
+ | undefined;
}
Review Comment:
Thank you for the help. I have added the relevant types, tested the functionality through SMTP and added the support for max attribute in the latest commit.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org
Re: [PR] feat(ui): add min|max values for inputs and context-based keyboards for inputs (for touch systems) [answer]
Posted by "shuashuai (via GitHub)" <gi...@apache.org>.
shuashuai commented on code in PR #1424:
URL: https://github.com/apache/answer/pull/1424#discussion_r2541328908
##########
ui/src/components/SchemaForm/components/Input.tsx:
##########
@@ -60,6 +75,9 @@ const Index: FC<Props> = ({
placeholder={placeholder}
type={type}
value={fieldObject?.value || ''}
+ min={min}
+ max={max}
+ inputMode={inputMode}
Review Comment:
> Could please guide me whether I should combine all the changes into a single commit or is it okay if I have multiple commits
Both are acceptable. Multiple commits within the same PR are allowed, as long as there is a clear commit history.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org
Re: [PR] feat(ui): add min|max values for inputs and context-based keyboards for inputs (for touch systems) [answer]
Posted by "shuashuai (via GitHub)" <gi...@apache.org>.
shuashuai merged PR #1424:
URL: https://github.com/apache/answer/pull/1424
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org