Skip to content

Compute function not being called #2

@madprops

Description

@madprops

I have a textarea called #input

chrome_2019-03-17_19-39-50

CSS:

#input
{
	font-size: 1rem;
	color: white;
	border: 0px solid black;
	padding-right: 1rem;
	margin-right: 1rem;
	outline: none;
	font-family: inherit;
	flex-grow: 1;
	background-color: transparent;
	color: inherit;
	resize: none;
	overflow-y: auto;
	overflow-x: hidden;
	position: relative;
	/* height: calc(100% - 0.6rem); */
	overflow-wrap: break-word;
	word-break: break-word;

	min-height: 1em;
	max-height: 50vh;
	height: var(--expand);
}

After load I call:

    computedVariables
    (
        '--expand',
        (value, event, tag) => {
            console.log(value)
            console.log(event)
            console.log(tag)
            tag.style.height = 'inherit'
            const height = tag.scrollHeight
            tag.style.height = ''
            return height + 'px'
        },
        "#input",
        ['input', 'paste', 'blur', 'reprocess']
    )

I would expect the function where the console.logs are to be called on an input event. No resizing happens, no console.logs are triggered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions