Skip to content

[Feature Request ]Enable htmlFor to work with pattern matching #501

@AnnMarieW

Description

@AnnMarieW

This would apply to the InputWrapper component.

Per the PR comment: it's possible to stringify dict ids to make the htmlFor prop work with pattern matching
#491 (review)

This is how it's done in Dash:

    // stringifies object ids used in pattern matching callbacks
    stringifyId(id) {
        if (typeof id !== 'object') {
            return id;
        }
        const stringifyVal = v => (v && v.wild) || JSON.stringify(v);
        const parts = Object.keys(id)
            .sort()
            .map(k => JSON.stringify(k) + ':' + stringifyVal(id[k]));
        return '{' + parts.join(',') + '}';
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions