fix: CycleButton internal prop state not initiating properly

closes #310
This commit is contained in:
tomasklaen
2022-10-09 11:47:40 +02:00
parent b5726097cc
commit 63fc2e8499

View File

@@ -2565,6 +2565,7 @@ function CycleButton:init(id, props)
-- Built in state props
if is_state_prop then
self['on_prop_' .. self.prop] = function(self, value) self.handle_change(self.prop, value) end
self.handle_change(self.prop, state[self.prop])
else
mp.observe_property(self.prop, 'string', self.handle_change)
end