diff --git a/src/UniversalDashboard.Materialize/Components/ud-fab.jsx b/src/UniversalDashboard.Materialize/Components/ud-fab.jsx index d67c34b5..f8fe158e 100644 --- a/src/UniversalDashboard.Materialize/Components/ud-fab.jsx +++ b/src/UniversalDashboard.Materialize/Components/ud-fab.jsx @@ -55,7 +55,7 @@ export default class UDFab extends React.Component { } class UDFabButton extends React.Component { - onClick() { + onClick(e) { if (this.props.onClick) { UniversalDashboard.publish('element-event', { type: "clientEvent", @@ -64,6 +64,8 @@ class UDFabButton extends React.Component { eventData: '' }); } + + e.stopPropagation() } render() { diff --git a/src/UniversalDashboard.Materialize/Scripts/fab.ps1 b/src/UniversalDashboard.Materialize/Scripts/fab.ps1 index 7900b067..3e587509 100644 --- a/src/UniversalDashboard.Materialize/Scripts/fab.ps1 +++ b/src/UniversalDashboard.Materialize/Scripts/fab.ps1 @@ -11,8 +11,8 @@ function New-UDFab { [Parameter()] [UniversalDashboard.Models.FontAwesomeIcons]$Icon, [Parameter()] - [ValidateSet("Small", "Large")] - $Size = "Large", + [ValidateSet("small", "large")] + $Size = "large", [Parameter()] [Switch]$Horizontal, [Parameter()] diff --git a/src/UniversalDashboard.Materialize/Tests/fab.tests.ps1 b/src/UniversalDashboard.Materialize/Tests/fab.tests.ps1 index 6c44e007..0747fcff 100644 --- a/src/UniversalDashboard.Materialize/Tests/fab.tests.ps1 +++ b/src/UniversalDashboard.Materialize/Tests/fab.tests.ps1 @@ -3,10 +3,12 @@ Describe "Fab" { Set-TestDashboard { New-UdFab -Id "main" -Icon "plus" -Size "large" -ButtonColor "red" -onClick { Set-TestData -Data "parent" + Show-UDToast -Message "Parent" } -Content { New-UDFabButton -ButtonColor "green" -Icon "edit" -size "small" New-UDFabButton -Id "btn" -ButtonColor "yellow" -Icon "trash" -size "large" -onClick { Set-TestData -Data "child" + Show-UDToast -Message "Child" } } }