Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 29, 2025

Summary

Fixed a documentation bug in the DataGrid Sort Storybook example where the required sortable prop was missing from the DataGrid component.

Problem

The DataGrid Sort example in Storybook wasn't functional because it was missing the sortable prop. The example's documentation clearly states:

"To enable sorting, the sortable prop needs to be set."

However, the actual code example was missing this required prop, making the sorting functionality non-functional for users following the documentation.

Solution

Added the missing sortable prop to the DataGrid component in the Sort story:

// Before
<DataGrid items={items} columns={columns} defaultSortState={defaultSortState} style={{ minWidth: '500px' }}>

// After  
<DataGrid items={items} columns={columns} sortable defaultSortState={defaultSortState} style={{ minWidth: '500px' }}>

This change aligns the example with:

  • The story's own documentation that mentions the sortable prop requirement
  • The SortControlled example that correctly includes the sortable prop
  • The expected user experience where clicking column headers enables sorting

Testing

  • ✅ All existing DataGrid tests continue to pass
  • ✅ Linting passes successfully
  • ✅ Change follows the same pattern as the working SortControlled example

Files Changed

  • packages/react-components/react-table/stories/src/DataGrid/Sort.stories.tsx

Fixes the issue reported in #[issue_number] where users following the Sort example documentation would encounter non-functional sorting.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Docs]: DataGrid sortable example missing sortable prop</issue_title>
<issue_description>### Area

React Components (https://react.fluentui.dev)

What kind of documentation issue are you reporting?

  • Reporting a typo
  • Reporting a documentation bug
  • Documentation improvement
  • Documentation feedback

Is there a specific documentation page you are reporting?

https://react.fluentui.dev/?path=/docs/components-datagrid--docs#sort

Description

The provided example for the Sort functionality is missing the needed sortable prop on DataGrid.

Validations

  • Check that there isn't already an issue that requests the same feature to avoid creating a duplicate.</issue_description>

<agent_instructions>update storybook example by adding sortable prop so it works as expected</agent_instructions>

Comments on the Issue (you are @copilot in this section)

Fixes #35196

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] [Docs]: DataGrid sortable example missing sortable prop Fix: Add missing sortable prop to DataGrid Sort example Sep 29, 2025
@Copilot Copilot AI requested a review from Hotell September 29, 2025 15:24
Copilot finished work on behalf of Hotell September 29, 2025 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Docs]: DataGrid sortable example missing sortable prop
3 participants