Skip to content

Conversation

@brendanatshopify
Copy link
Contributor

WHY are these changes introduced?

Fixes #4076

WHAT is this pull request doing?

How to 🎩

🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines

Copy-paste this code in playground/Playground.tsx:
import React from 'react';
import {Page} from '../src';

export function Playground() {
  return (
    <Page title="Playground">
      {/* Add the code you want to test in here */}
    </Page>
  );
}

🎩 checklist

@ghost
Copy link

ghost commented Aug 9, 2021

👋 Thanks for opening your first pull request. A contributor should give feedback soon. If you haven’t already, please check out the contributing guidelines.

ryanwilsonperkin and others added 8 commits August 10, 2021 10:15
Within the IndexProvider the value is accepted as a prop but isn't being
used, when it should be. There's already an existing identifier
"selectable" which can be renamed as "actionable" because it indicates
whether or not actions can be made (are there bulk actions available).
Similarly in the useBulkSelectionData hook there's an existing
identifier "selectable" where it means "does it currently have any
selections. It's a temporary variable created to indicate whether or not
any selections have been made, so we rename it to "hasSelections" even
though the scope doesn't conflict - just to make it clearer.
This was previously always the case, and when the selectable prop is not
provided we would still expect it to default to true, because the main
behaviour of this component is for use as a selectable index.

This provides backwards compatibility, while still supporting explicitly
passing this value as true/false.
Simplifies the closure function because it no longer has multiple return
signatures (returning either JSX or JSX[], depending on whether or not
its the first element).

Splits out a second one that's specifically for rendering the checkbox,
and then explicitly calling that and pushing it into the array when
selectable.
@brendanatshopify brendanatshopify force-pushed the shop-channel-fix-selectable-index-table branch from 96a18d5 to 67240ff Compare August 10, 2021 14:23
@brendanatshopify
Copy link
Contributor Author

Closing in favor of #4376

@brendanatshopify brendanatshopify deleted the shop-channel-fix-selectable-index-table branch September 1, 2021 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[IndexTable] selectable prop being set to false has no effect

2 participants