Skip to content

Using a type of SimpleSchema.oneOf prevents custom function from being called #68

Closed
@nidem

Description

@nidem

This code will call the custom function:

value:
    label: 'Value'
    type: String
    custom: ->
        console.log 'in custom'
        console.log this
        return undefined

This will not:

value:
    label: 'Value'
    type: SimpleSchema.oneOf(String, Boolean)
    custom: ->
        console.log 'in custom'
        console.log this
        return undefined

Edit: Original written in CoffeeScript, but easy to convert

value: {
    label: 'Value',
    type: TRY_STRING_OR_ONEOF,
    custom: function () {
        // This runs when type == String, but not when SimpleScheme.oneOf
        console.log('in custom')
        console.log(this)
        return undefined
    }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions