Skip to content

Documentation doesn't mention anything about required events #2

@joeyfigaro

Description

@joeyfigaro

Attempted to wrap an existing component:

<Scroll
	type="class"
	element="response-scroll-target"
>
	<Box
		column
		className="response-scroll-target"
	>
		{this.props.type === 'success' ? (
			<React.Fragment>
				<Text variant={this.props.type}>
					{this.props.x.header}
				</Text>
				<Text variant="body">{this.props.x.message}</Text>
				<ConfirmationButton secondary>Next</ConfirmationButton>
			</React.Fragment>
		) : (
			<React.Fragment>
				<Text variant={this.props.type}>
					{this.props.y.header}
				</Text>
				<Text variant="body">{this.props.y.message}</Text>
			</React.Fragment>
		)}
	</Box>
</Scroll>

Doesn't work with offset, either:

<Scroll offset={3000}>
	<Box
		column
		className="response-scroll-target"
	>
		{this.props.type === 'success' ? (
			<React.Fragment>
				<Text variant={this.props.type}>
					{this.props.x.header}
				</Text>
				<Text variant="body">{this.props.x.message}</Text>
				<ConfirmationButton secondary>Next</ConfirmationButton>
			</React.Fragment>
		) : (
			<React.Fragment>
				<Text variant={this.props.type}>
					{this.props.y.header}
				</Text>
				<Text variant="body">{this.props.y.message}</Text>
			</React.Fragment>
		)}
	</Box>
</Scroll>

but doesn't seem to do anything. It's a little unclear how this is expected to work as a component—using snippets from the documented examples don't work either. I'll take a crack at putting up a PR with updated documentation if I can get 'er working.

update: Looks like the component requires a click to fire off scrollTo.

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