             @_hasKeyDeps[key] ?= new Tracker.Dependency @creator
             @_hasKeyDeps[key].depend()
 
-        key of @_fields
+        if _filtered and @filterFunc?
+            key of @_fields and @tryGet(key) isnt undefined
+        else
+            key of @_fields
 
 
     isActive: ->


        @keysFunc = keysFunc
        @valueFunc = valueFunc

        @_keysVar = J.AutoVar(
            (



    getKeys: ->
        if @filterFunc?
            @_keysVar.get().filter (key) =>
                value = @_fields[key].tryGet()
                value isnt undefined and @filterFunc value
        else
            @_keysVar.get()


    hasKey: (key, _filtered = true) ->
        if @_keysVar._value is undefined or @_keysVar._invalidAncestors.length
            # This might have a special @_replaceKeys side effect
            # which then makes the logic in super work
