Skip to content

Commit

Permalink
Remove unnecessary extra code
Browse files Browse the repository at this point in the history
Signed-off-by: Martha Cryan <Martha.Cryan@ibm.com>
  • Loading branch information
Martha Cryan authored and Martha Cryan committed Jan 4, 2023
1 parent ac240b8 commit 4b5e50a
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions packages/ui-components/src/FormDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ export const showFormDialog = async (
dialogBody.node
.querySelectorAll('select, input, textarea')
.forEach((element: any) => {
if (
element.hasAttribute('data-form-required') ||
element.type === 'number'
) {
if (element.hasAttribute('data-form-required')) {
const elementTagName = element.tagName.toLowerCase();

if (elementTagName === 'select' || element.type === 'number') {
Expand Down Expand Up @@ -135,11 +132,6 @@ const preventDefaultDialogHandler = (

// Returns true if given element is valid
const isFieldValid = (element: any): boolean => {
if (element.type === 'number') {
return element.hasAttribute('data-form-required')
? element.value !== ''
: true;
}
return element.value.trim() ? true : false;
};

Expand Down

0 comments on commit 4b5e50a

Please sign in to comment.