mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 15:36:02 +01:00
refactor(web/radial): disable nui focus when closing with x button
This commit is contained in:
@@ -97,6 +97,17 @@ RegisterNUICallback('radialBack', function(_, cb)
|
|||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
RegisterNUICallback('radialClose', function(_, cb)
|
||||||
|
cb(1)
|
||||||
|
|
||||||
|
if not isOpen then return end
|
||||||
|
|
||||||
|
SetNuiFocus(false, false)
|
||||||
|
|
||||||
|
isOpen = false
|
||||||
|
currentRadial = nil
|
||||||
|
end)
|
||||||
|
|
||||||
lib.addKeybind({
|
lib.addKeybind({
|
||||||
name = 'ox_lib-radial',
|
name = 'ox_lib-radial',
|
||||||
description = 'Open radial menu',
|
description = 'Open radial menu',
|
||||||
|
|||||||
@@ -124,7 +124,11 @@ const RadialMenu: React.FC = () => {
|
|||||||
<g
|
<g
|
||||||
transform={`translate(175, 175)`}
|
transform={`translate(175, 175)`}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
menu.sub ? fetchNui('radialBack') : setVisible(false);
|
if (menu.sub) fetchNui('radialBack');
|
||||||
|
else {
|
||||||
|
setVisible(false);
|
||||||
|
fetchNui('radialClose');
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<circle r={30} className={classes.centerCircle} />
|
<circle r={30} className={classes.centerCircle} />
|
||||||
|
|||||||
Reference in New Issue
Block a user