LauraXia123 commented on code in PR #10153:
URL: https://github.com/apache/gravitino/pull/10153#discussion_r2881608704


##########
web-v2/web/src/app/catalogs/rightContent/CreateTableDialog.js:
##########
@@ -925,16 +967,17 @@ export default function CreateTableDialog({ ...props }) {
                 <div className='px-2 py-1'>
                   <Icons.Minus
                     className={cn('size-4 cursor-pointer text-gray-400 
hover:text-defaultPrimary', {
-                      'text-gray-100 hover:text-gray-200 cursor-not-allowed': 
form.getFieldValue('columns').length === 1
+                      'text-gray-100 hover:text-gray-200 cursor-not-allowed':
+                        form.getFieldValue('columns').length === 1 && 
isColumnsRequired
                     })}
                     onClick={() => {
-                      if (form.getFieldValue('columns').length === 1) return
+                      if (form.getFieldValue('columns').length === 1 && 
isColumnsRequired) return
                       subOpt.remove(subField.name)
                       if (fields.length - 1 === pageOffset * pageSize) {
-                        setPageOffset(pageOffset - 1)
+                        setPageOffset(Math.max(1, pageOffset - 1))
                       } else if (fields.length - 1 < pageOffset * pageSize) {
                         const to = Math.ceil(fields.length / pageSize)
-                        setPageOffset((fields.length - 1) % pageSize === 0 ? 
to - 1 : to)
+                        setPageOffset(Math.max(1, (fields.length - 1) % 
pageSize === 0 ? to - 1 : to))
                       }

Review Comment:
   It's an another improve issue, and have no good fix work currently.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to