Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
3cf5c185
Unverified
Commit
3cf5c185
authored
Feb 28, 2024
by
crazywoola
Committed by
GitHub
Feb 28, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: default button behavior (#2609)
parent
a4d86496
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
index.tsx
web/app/components/base/button/index.tsx
+5
-9
No files found.
web/app/components/base/button/index.tsx
View file @
3cf5c185
...
...
@@ -3,16 +3,13 @@ import React from 'react'
import
Spinner
from
'../spinner'
export
type
IButtonProps
=
{
/**
* The style of the button
*/
type
?:
'primary'
|
'warning'
|
(
string
&
{})
type
?:
string
className
?:
string
disabled
?:
boolean
loading
?:
boolean
tabIndex
?:
number
children
:
React
.
ReactNode
onClick
?:
MouseEventHandler
<
HTML
Button
Element
>
onClick
?:
MouseEventHandler
<
HTML
Div
Element
>
}
const
Button
:
FC
<
IButtonProps
>
=
({
...
...
@@ -38,16 +35,15 @@ const Button: FC<IButtonProps> = ({
}
return
(
<
button
<
div
className=
{
`btn ${style} ${className && className}`
}
tabIndex=
{
tabIndex
}
disabled=
{
disabled
}
onClick=
{
onClick
}
onClick=
{
disabled
?
undefined
:
onClick
}
>
{
children
}
{
/* Spinner is hidden when loading is false */
}
<
Spinner
loading=
{
loading
}
className=
'!text-white !h-3 !w-3 !border-2 !ml-1'
/>
</
button
>
</
div
>
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment