Skip to content

Commit

Permalink
Fixed __newindex issue
Browse files Browse the repository at this point in the history
  • Loading branch information
cmmiller26 authored Apr 28, 2024
1 parent 2488ccc commit 717a98f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/component/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -318,16 +318,16 @@ function Component.new(config: ComponentConfig)
end

function Component:_instantiate(instance: Instance)
self.__newindex = function(_, key, value)
if self._propertyChangedSignal then
self.__newindex = function(tbl, key, value)
if tbl._propertyChangedSignal then
if type(key) == "string" then
local firstChar = string.sub(key, 1, 1)
if firstChar ~= "_" and firstChar == string.upper(firstChar) then
self._propertyChangedSignal:Fire(key, value)
tbl._propertyChangedSignal:Fire(key, value)
end
end
end
rawset(self, key, value)
rawset(tbl, key, value)
end
local component = setmetatable({}, self)
component.Instance = instance
Expand Down

0 comments on commit 717a98f

Please sign in to comment.