Skip to content

Commit

Permalink
feat(nx-adsp): adding support for maxLength in react form generator
Browse files Browse the repository at this point in the history
Update react component to latest version for max length support on input.
  • Loading branch information
tzuge committed Jul 4, 2023
1 parent 5865d56 commit 25cd8c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/nx-adsp/src/generators/react-app/react-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ export default async function (host: Tree, options: Schema) {
host,
{},
{
'@abgov/react-components': '^4.5.0',
'@abgov/web-components': '^1.5.0',
'@abgov/react-components': '^4.11.0',
'@abgov/web-components': '^1.11.0',
'@types/react-router-dom': '~5.3.3',
'@types/redux-mock-store': '~1.0.2',
'html-webpack-plugin': '~5.5.0',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
disabled={isReadOnly || inReview}
error={errors[`<%= path %>`]}
placeholder="<%= property?.examples?.join(', ') || '' %>"
<%_ if (property?.maxLength !== undefined) { _%>
maxLength={<%= property?.maxLength %>}
<%_ } _%>
onChange={(name, updated) => <%- inArray ? `onArrayItemChange(onChange, value, '${parent}', idx, ` : 'onChange(' %>{ ...<%= valueVar %>, [name]: updated })}
value={`${<%= valueVar %>.<%= key %> || ''}`}
name="<%= key %>"
Expand Down

0 comments on commit 25cd8c0

Please sign in to comment.