Skip to content

Improvements for auto-select opt-in mode#4914

Merged
ThomasMichon merged 3 commits intomicrosoft:masterfrom
ThomasMichon:auto-select
May 23, 2018
Merged

Improvements for auto-select opt-in mode#4914
ThomasMichon merged 3 commits intomicrosoft:masterfrom
ThomasMichon:auto-select

Conversation

@ThomasMichon
Copy link
Copy Markdown
Member

Overview

This change adds non-breaking improvements to #4907:

  1. Pass selectionZoneProps through DetailsList to avoid having to pass each prop individually.
  2. Add data-selection-auto-select as a preferred alias for data-selection-select to match original proposal in Hyperlink clicks aren't selecting items in SelectionZone (Disabled in PR 4544) #4866.

<button id='invoke1' data-selection-invoke={ true }>Invoke</button>
<button id='noSelect1'>No Select</button>
<button id='select1' data-selection-select={ true }>Select First</button>
<button id='select1' data-selection-auto-select={ true }>Select First</button>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is too verbose. Why this change?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also think selection-select is redundant with no obvious reasoning, though

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I spoke with David now and am agreeing with him now.. it's a select type like toggle. 😆

onItemInvoked={ onItemInvoked }
onItemContextMenu={ onItemContextMenu }
enterModalOnTouch={ this.props.enterModalSelectionOnTouch }
{ ...(selectionZoneProps || {}) }
Copy link
Copy Markdown
Member

@JasonGore JasonGore May 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is {} needed? Spreading undefined object should be ok

Copy link
Copy Markdown
Member Author

@ThomasMichon ThomasMichon May 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to ES6, {} is needed because otherwise it would fail. TypeScript's implementation just doesn't fail, though.

Edit: clarified language.

} else if (
(target === itemRoot ||
this._hasAttribute(target, SELECTION_AUTO_SELECT_ATTRIBUTE_NAME) ||
this._hasAttribute(target, SELECTION_SELECT_ATTRIBUTE_NAME))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this check for the new attribute be in _onKeyDown too?

@ThomasMichon ThomasMichon merged commit 413d031 into microsoft:master May 23, 2018
Markionium added a commit to Markionium/office-ui-fabric-react that referenced this pull request May 29, 2018
* master:
  Applying package updates.
  Shimmer: refactor in preparation for migration to OUFR (microsoft#4958)
  Applying package updates.
  Theming: fix error colors (microsoft#4969)
  MaskedTextField: Added event callback passthrough (microsoft#4956)
  Experiments/Nav component: Enable auto expand until the next manual expand disables the auto expand (microsoft#4996)
  Applying package updates.
  Experiments/Nav component: Auto select/expand based on the selectedKey prop (microsoft#4984)
  StickyPane: fix Array.from in Ie (microsoft#4982)
  ContextualMenu has aria-labelledBy referencing element not in DOM (microsoft#4963)
  Keyboard support for the slim version of experiments/Nav component and added aria attributes (microsoft#4981)
  Move ghdocs to wiki (microsoft#4977)
  Remove build artifacts (microsoft#4976)
  Revisited the Multi-select Combo box initial state selection fix (microsoft#4884)
  Applying package updates.
  readme cleanup (microsoft#4972)
  Theming: add the bodyBackgroundDarker semantic slot (microsoft#4957)
  Improvements for auto-select opt-in mode (microsoft#4914)
Markionium added a commit to Markionium/office-ui-fabric-react that referenced this pull request May 29, 2018
* master: (85 commits)
  Applying package updates.
  Shimmer: refactor in preparation for migration to OUFR (microsoft#4958)
  Applying package updates.
  Theming: fix error colors (microsoft#4969)
  MaskedTextField: Added event callback passthrough (microsoft#4956)
  Experiments/Nav component: Enable auto expand until the next manual expand disables the auto expand (microsoft#4996)
  Applying package updates.
  Experiments/Nav component: Auto select/expand based on the selectedKey prop (microsoft#4984)
  StickyPane: fix Array.from in Ie (microsoft#4982)
  ContextualMenu has aria-labelledBy referencing element not in DOM (microsoft#4963)
  Keyboard support for the slim version of experiments/Nav component and added aria attributes (microsoft#4981)
  Move ghdocs to wiki (microsoft#4977)
  Remove build artifacts (microsoft#4976)
  Revisited the Multi-select Combo box initial state selection fix (microsoft#4884)
  Applying package updates.
  readme cleanup (microsoft#4972)
  Theming: add the bodyBackgroundDarker semantic slot (microsoft#4957)
  Improvements for auto-select opt-in mode (microsoft#4914)
  Applying package updates.
  Revert ChoiceGroup change in 5.0 to minimize potential partner impact. (microsoft#4962)
  ...
@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants