Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Dropdown): don't clear value on same item selection #12784

Merged
merged 6 commits into from
Apr 22, 2020
Merged

fix(Dropdown): don't clear value on same item selection #12784

merged 6 commits into from
Apr 22, 2020

Conversation

silviuaavram
Copy link
Contributor

@silviuaavram silviuaavram commented Apr 20, 2020

Pull request checklist

  • Addresses an existing issue: Fixes #0000
  • Include a change request file using $ yarn change

Description of changes

Checks on selection if item coming from Downshift is not undefined. This is the case when the same item is selected. If it's the same item, will not update value or trigger a selection a11y message.

Focus areas to test

(optional)

Microsoft Reviewers: Open in CodeFlow

@size-auditor
Copy link

size-auditor bot commented Apr 20, 2020

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: 11d5a626aac03900f8e8e8f82379374323c93639 (build)

@msft-github-bot
Copy link
Contributor

msft-github-bot commented Apr 20, 2020

Perf Analysis

No significant results to display.

All results

Scenario Master Ticks PR Ticks Iterations Status
BaseButton 761 742 5000
Checkbox 1550 1445 5000
CheckboxBase 1300 1272 5000
ChoiceGroup 4617 4629 5000
ComboBox 881 849 1000
CommandBar 6402 6596 1000
ContextualMenu 10633 10834 1000
DefaultButton 992 969 5000
DetailsRow 3079 3108 5000
DetailsRow (fast icons) 3199 3164 5000
DetailsRow without styles 2912 2942 5000
Dialog 1373 1297 1000
DocumentCardTitle with truncation 1353 1443 1000
Dropdown 2262 2261 5000
FocusZone 1399 1364 5000
IconButton 1593 1554 5000
Label 281 264 5000
Link 434 443 5000
MenuButton 1431 1281 5000
Nav 2905 2822 1000
Panel 1283 1310 1000
Persona 760 781 1000
Pivot 1146 1185 1000
PrimaryButton 1103 1144 5000
SearchBox 1206 1159 5000
Slider 1334 1426 5000
Spinner 342 345 5000
SplitButton 2769 2817 5000
Stack 412 408 5000
Stack with Intrinsic children 1004 1024 5000
Stack with Text children 3974 3923 5000
TagPicker 2447 2518 5000
Text 343 364 5000
TextField 1346 1221 5000
Toggle 791 807 5000
button 57 55 5000

Perf Analysis (Fluent)

Perf comparison
Status Scenario Fluent TPI Fabric TPI Ratio Iterations Ticks
🔧 Avatar.Fluent 0.46 0.45 1.02:1 2000 913
🦄 Button.Fluent 0.1 0.18 0.56:1 5000 518
🔧 Checkbox.Fluent 0.59 0.32 1.84:1 1000 591
🔧 Dialog.Fluent 0.32 0.19 1.68:1 5000 1605
🔧 Dropdown.Fluent 2.99 0.39 7.67:1 1000 2987
🔧 Icon.Fluent 0.13 0.05 2.6:1 5000 668
🎯 Image.Fluent 0.08 0.1 0.8:1 5000 421
🔧 Slider.Fluent 1.2 0.35 3.43:1 1000 1200
🔧 Text.Fluent 0.08 0.02 4:1 5000 381
🦄 Tooltip.Fluent 0.08 12.6 0.01:1 5000 422

🔧 Needs work     🎯 On target     🦄 Amazing

Perf tests with no regressions
Scenario Current PR Ticks Baseline Ticks Ratio
RefMinimalPerf.default 203 175 1.16:1
Text.Fluent 381 339 1.12:1
TooltipMinimalPerf.default 725 656 1.11:1
VideoMinimalPerf.default 658 599 1.1:1
IconMinimalPerf.default 675 617 1.09:1
HierarchicalTreeMinimalPerf.default 1026 963 1.07:1
ListNestedPerf.default 890 831 1.07:1
PortalMinimalPerf.default 305 284 1.07:1
CarouselMinimalPerf.default 577 545 1.06:1
HeaderSlotsPerf.default 1531 1439 1.06:1
DialogMinimalPerf.default 1694 1607 1.05:1
ImageMinimalPerf.default 381 362 1.05:1
InputMinimalPerf.default 900 855 1.05:1
ListMinimalPerf.default 494 469 1.05:1
TextMinimalPerf.default 356 343 1.04:1
FlexMinimalPerf.default 313 305 1.03:1
Avatar.Fluent 913 887 1.03:1
Dropdown.Fluent 2987 2907 1.03:1
AttachmentSlotsPerf.default 1121 1101 1.02:1
MenuButtonMinimalPerf.default 1501 1473 1.02:1
ProviderMinimalPerf.default 594 581 1.02:1
RadioGroupMinimalPerf.default 563 554 1.02:1
SliderMinimalPerf.default 1242 1221 1.02:1
TableMinimalPerf.default 561 550 1.02:1
Button.Fluent 518 508 1.02:1
Image.Fluent 421 414 1.02:1
CheckboxMinimalPerf.default 2694 2665 1.01:1
DropdownMinimalPerf.default 2924 2887 1.01:1
EmbedMinimalPerf.default 3932 3902 1.01:1
ItemLayoutMinimalPerf.default 1653 1637 1.01:1
Checkbox.Fluent 591 588 1.01:1
LabelMinimalPerf.default 424 425 1:1
SegmentMinimalPerf.default 885 887 1:1
TextAreaMinimalPerf.default 2459 2454 1:1
CustomToolbarPrototype.default 3184 3199 1:1
ToolbarMinimalPerf.default 1013 1017 1:1
ButtonMinimalPerf.default 158 159 0.99:1
ChatDuplicateMessagesPerf.default 394 398 0.99:1
ChatWithPopoverPerf.default 518 521 0.99:1
MenuMinimalPerf.default 1730 1745 0.99:1
ProviderMergeThemesPerf.default 1392 1406 0.99:1
SplitButtonMinimalPerf.default 3224 3256 0.99:1
TreeMinimalPerf.default 1174 1184 0.99:1
TreeWith60ListItems.default 198 201 0.99:1
Dialog.Fluent 1605 1615 0.99:1
Tooltip.Fluent 422 426 0.99:1
AnimationMinimalPerf.default 645 655 0.98:1
AttachmentMinimalPerf.default 144 147 0.98:1
DropdownManyItemsPerf.default 1253 1284 0.98:1
StatusMinimalPerf.default 699 712 0.98:1
Icon.Fluent 668 680 0.98:1
Slider.Fluent 1200 1224 0.98:1
AlertMinimalPerf.default 287 295 0.97:1
AvatarMinimalPerf.default 475 491 0.97:1
BoxMinimalPerf.default 318 328 0.97:1
ChatMinimalPerf.default 602 622 0.97:1
ListWith60ListItems.default 1071 1109 0.97:1
LoaderMinimalPerf.default 730 750 0.97:1
ButtonSlotsPerf.default 542 566 0.96:1
CardMinimalPerf.default 559 584 0.96:1
PopupMinimalPerf.default 243 254 0.96:1
DividerMinimalPerf.default 680 719 0.95:1
FormMinimalPerf.default 737 774 0.95:1
GridMinimalPerf.default 681 714 0.95:1
LayoutMinimalPerf.default 546 572 0.95:1
HeaderMinimalPerf.default 489 518 0.94:1
ReactionMinimalPerf.default 1710 1833 0.93:1
ListCommonPerf.default 926 1008 0.92:1
AccordionMinimalPerf.default 182 217 0.84:1

@@ -912,14 +912,18 @@ class Dropdown extends AutoControlledComponent<WithAsProp<DropdownProps>, Dropdo
case Downshift.stateChangeTypes.keyDownEnter:
case Downshift.stateChangeTypes.clickItem:
const shouldAddHighlightedIndex = !multiple && items && items.length > 0;
const isSameItemSelected = changes.selectedItem === undefined;
Copy link
Contributor

Choose a reason for hiding this comment

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

const isSameItemSelected = changes.selectedItem === undefined;
const newValue = isSameItemSelected ? value[0] : changes.selectedItem;

newState.open = false;
newState.searchQuery = this.getSelectedItemAsString(newValue);
if (!isSameItemSelected) {
    newState.value = multiple ? [...value, changes.selectedItem] : [changes.selectedItem];
    newState.highlightedIndex = shouldAddHighlightedIndex ? items.indexOf(newValue) : null;

    if (getA11ySelectionMessage && getA11ySelectionMessage.onAdd) {
      this.setA11ySelectionMessage(getA11ySelectionMessage.onAdd(changes.selectedItem));        
    }
}

nit
Would having newState.value, newState.highlightedIndex and this.setA11ySelectionMessage inside ! isSameItemSelected condition work the same?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cool! it might work, let me try!

@silviuaavram silviuaavram merged commit 3b8eec1 into microsoft:master Apr 22, 2020
@silviuaavram silviuaavram deleted the fix/dropdown-same-selection branch April 22, 2020 16:27
assuncaocharles pushed a commit to assuncaocharles/fluentui that referenced this pull request Apr 23, 2020
)

* fix same item selection

* improve the unit test

* changelog

* improve code
assuncaocharles added a commit that referenced this pull request Apr 24, 2020
* Roster prototype

* Section not public.

* firt raw version of multiselect tree availability

* unit tests fix

* changing to proper default selection usage

* adressing comment from review, moving Enter filtration to behaviors

* improving code

* polish name, removing not used import

* fixing based on the review, adding screener tests

* removing not used line

* adding behavior test and running lint fix

* feat(Roster): Suggestion with prop `as`

* feat(Roster): Fix keyboard navigation

* feat(Roster): Add Selecttion event

* changing shorthand from ts to tsx

* feat(Roster): Add multiselection

* feat(Roster): Remove Console

* adressing review changes and fix console errors

* feat(Roster): Fix styles for select all

* fixing unstability in screener toolbar test

* improving screener test to cover one more scenario

* feat(Roster): Adding custom idicator prop to the tree

* feat(Roster): Click on item

* feat(Roster): Fix selection

* feat(Roster): add data-is-focusable to custom checkbox

* feat(Roster): Rename props

* fixes from review

* fix from merging another branch

* map prop to behavior

* removing roster prototype

* removing leftover from sidebar

* changing name for custom checkbox

* fixing navigation into cell which has multiple focusable elements

* updating changelog

* feat(Roster): Replace as with children in the data

* feat(Tree): Fix tree selection

* feat(Tree): Remove dead file

* adding table keyboard navigation tests

* deleting from master

* adding table keyboard navigation tests

* deleting files from master, pushed by mistaked

* feat(Tree): remove dup spread props

* feat(Tree): Revert context value prop

* Update packages/fluentui/accessibility/src/behaviors/Tree/treeItemBehavior.ts

Co-Authored-By: Roman Sudarikov <pompomon@users.noreply.github.com>

* Update packages/fluentui/react-northstar/src/components/Tree/TreeItem.tsx

Co-Authored-By: Marija Najdova <mnajdova@gmail.com>

* Update packages/fluentui/react-northstar/src/components/Tree/TreeTitle.tsx

Co-Authored-By: Marija Najdova <mnajdova@gmail.com>

* Update packages/fluentui/react-northstar/src/themes/teams/components/Tree/treeTitleVariables.ts

Co-Authored-By: Marija Najdova <mnajdova@gmail.com>

* Update packages/fluentui/accessibility/src/behaviors/Tree/treeTitleBehavior.ts

Co-Authored-By: Oleksandr Fediashov <alexander.mcgarret@gmail.com>

* Update packages/fluentui/react-northstar/src/components/Tree/Tree.tsx

Co-Authored-By: Oleksandr Fediashov <alexander.mcgarret@gmail.com>

* Update packages/fluentui/react-northstar/src/components/Tree/TreeItem.tsx

Co-Authored-By: Oleksandr Fediashov <alexander.mcgarret@gmail.com>

* feat(Tree): Temp removing option to pass a custom checkbox to the selectable tree

* Update packages/fluentui/docs/src/examples/components/Tree/Usage/TreeMultiselectExample.shorthand.tsx

Co-Authored-By: Oleksandr Fediashov <alexander.mcgarret@gmail.com>

* feat(Tree): Reduce over forEach

* feat(Tree): Typo

* Update packages/fluentui/accessibility/test/behaviors/treeTitleBehavior-test.tsx

Co-Authored-By: Roman Sudarikov <pompomon@users.noreply.github.com>

* feat(Tree): Enable select all nested children

* feat(Tree): Fix select on right click

* feat(Tree): Reverting non-related file

* feat(Tree): Fix tree title behavior tests

* feat(Tree): Fix behavior test for subTree

* feat(Tree): Outline treetitle as block  when selectable

* feat(Tree): Custom Select Indicator

* feat(Tree): Remove focus from custom checkbox

* feat(Tree): fix select all

* removing rtl types and fix if condition for not selectable item

* adding example that will handle custom selectable parent and default

* adding methods to check if all or some of children of a groups has been selected

* handling incompleted group selected

* adding icon for 3rd checkbox state

* feat(Tree): Improve determinated state for selectable parent

* feat(Tree): enable toggle parent select using keyboard

* feat(Tree): indeterminated state url file

* chore(treeTitleVariables): remove lodash

* feat(Tree): border color

* feat(Tree): add step

* feat(Tree): Remove Dup File

* feat(Tree): Right condition

* feat(Tree): Adapt example

* feat(Tree): Fix behavior test

* feat(Tree): Toggle multiselection

* feat(Tree): Toggle multiselection

* feat(Tree): Remove keyboard import

* feat(Tree): Fix conditions

* feat(Tree): Fix test behaviors

* feat(Tree): Remove select on enter

* feat(Tree): Active items test

* feat(Tree): Space select screenshot

* feat(Tree): Review changes

* feat(Tree): Fix test

* feat(Tree): remove log

* feat(Tree): steps

* fix(Dropdown): don't clear value on same item selection (#12784)

* fix same item selection

* improve the unit test

* changelog

* improve code

* hide/unhide legends (#12469)

* adding new prop hideLegend in donut chart and line chart which decides to show or hide legends

* Change files

Co-authored-by: v-sivsar <v-sivsar@microsoft.com>

* User/v sivsar/linchart line click (#12548)

* adding onclick to the line in the line chart

* Change files

Co-authored-by: v-sivsar <v-sivsar@microsoft.com>

* chore(TableRow): Convert to FC (#12797)

* Convert TableRow to FC

* Update Changlelog

* Fix imports

* Apply suggestions from code review

Co-Authored-By: Marija Najdova <mnajdova@gmail.com>

* Add TableRow onClick to handled props

* Properly add onClick to handledProps

Co-authored-by: Marija Najdova <mnajdova@gmail.com>

* FocusZone: Adding preventDefaultWhenHandled to v7 version (#12636)

#### Pull request checklist

- [ ] Addresses an existing issue: Fixes #0000
- [x] Include a change request file using `$ yarn change`

#### Description of changes

This PR brings the `preventDefaultWhenHandled` prop from the v0 version of `FocusZone` to the v7 version. This prop, if true, prevents the default behavior of focus events.

#### Focus areas to test

(optional)

* FocusZone: Updating comment for preventDefaultWhenHandled prop (#12830)

#### Pull request checklist

- [ ] Addresses an existing issue: Fixes #0000
- [x] Include a change request file using `$ yarn change`

#### Description of changes

`FocusZone`: Updating comment for `preventDefaultWhenHandled` prop to be consistent across both versions.

#### Focus areas to test

(optional)

* feature: improve `compose()` signature (#12745)

* feat: compose sig

* wip

* bump api

* -cleanup

* -changed compose tests

* -fixed any

* -fixed screener regressions

* -fixed build issues
-fixed screener

* Update packages/react-compose/src/types.ts

Co-Authored-By: Oleksandr Fediashov <olfedias@microsoft.com>

* fix types in ButtonContent

* -update api

* -test updates

* -ts fixes

* -added shorthandConfig in Button component

* -fixed compose test

* -fix

* Update packages/fluentui/react-northstar/src/components/Box/Box.tsx

Co-Authored-By: Roman Sudarikov <pompomon@users.noreply.github.com>

* Update packages/fluentui/react-northstar/src/components/Button/Button.tsx

Co-Authored-By: Roman Sudarikov <pompomon@users.noreply.github.com>

* fixes

* wip

* fix RefForward to handle `innerRef` changes

* reverted Accordion changes

* -tslint disable

* -screener diff

* -testing

* -reverted changes

* -better description

* fix build

* changelog entry

* Update packages/fluentui/CHANGELOG.md

Co-Authored-By: Oleksandr Fediashov <olfedias@microsoft.com>

Co-authored-by: Marija Najdova <mnajdova@gmail.com>
Co-authored-by: Roman Sudarikov <pompomon@users.noreply.github.com>

* applying package updates

* Callout: Updating positioning logic to account for dual screen scenarios (#12785)

#### Pull request checklist

- [ ] Addresses an existing issue: Fixes #0000
- [x] Include a change request file using `$ yarn change`

#### Description of changes

This PR updates the positioning logic in the `Callout` component to make it dual-screen aware using the new `windowSegments` API. Components using `Callout` underneath such as `ContextualMenu` are also updated.

This PR also adds a bunch of unit tests checking that the correct bounds for the screen segments are being calculated.

__Before:__
![Before](https://user-images.githubusercontent.com/7798177/79797849-dd11d100-830c-11ea-8303-c1147d8f0f79.gif)

__After:__
![After](https://user-images.githubusercontent.com/7798177/79797858-e13dee80-830c-11ea-8acc-6df9f44148cd.gif)

#### Focus areas to test

* feat(Tree): steps

Co-authored-by: Michal <michal.frdlik@hotmail.com>
Co-authored-by: Milan Turon <mituron@microsoft.com>
Co-authored-by: Milan Turon <milanturon@centrum.cz>
Co-authored-by: Charles Assuncao <chassunc@microsoft.com>
Co-authored-by: Roman Sudarikov <pompomon@users.noreply.github.com>
Co-authored-by: Marija Najdova <mnajdova@gmail.com>
Co-authored-by: Oleksandr Fediashov <alexander.mcgarret@gmail.com>
Co-authored-by: Charles Assuncao <charles.assuncao@microsoft.com>
Co-authored-by: Silviu Alexandru Avram <silviu.avram91@gmail.com>
Co-authored-by: shivasai09 <33802398+shivasai09@users.noreply.github.com>
Co-authored-by: v-sivsar <v-sivsar@microsoft.com>
Co-authored-by: Makoto Morimoto <humbertomakotomorimoto@gmail.com>
Co-authored-by: Oleksandr Fediashov <olfedias@microsoft.com>
Co-authored-by: Fluent UI Build <fluentui-internal@service.microsoft.com>
DuanShaolong pushed a commit to DuanShaolong/fluentui that referenced this pull request Apr 27, 2020
)

* fix same item selection

* improve the unit test

* changelog

* improve code
DuanShaolong pushed a commit to DuanShaolong/fluentui that referenced this pull request Apr 27, 2020
…oft#12822)

* Roster prototype

* Section not public.

* firt raw version of multiselect tree availability

* unit tests fix

* changing to proper default selection usage

* adressing comment from review, moving Enter filtration to behaviors

* improving code

* polish name, removing not used import

* fixing based on the review, adding screener tests

* removing not used line

* adding behavior test and running lint fix

* feat(Roster): Suggestion with prop `as`

* feat(Roster): Fix keyboard navigation

* feat(Roster): Add Selecttion event

* changing shorthand from ts to tsx

* feat(Roster): Add multiselection

* feat(Roster): Remove Console

* adressing review changes and fix console errors

* feat(Roster): Fix styles for select all

* fixing unstability in screener toolbar test

* improving screener test to cover one more scenario

* feat(Roster): Adding custom idicator prop to the tree

* feat(Roster): Click on item

* feat(Roster): Fix selection

* feat(Roster): add data-is-focusable to custom checkbox

* feat(Roster): Rename props

* fixes from review

* fix from merging another branch

* map prop to behavior

* removing roster prototype

* removing leftover from sidebar

* changing name for custom checkbox

* fixing navigation into cell which has multiple focusable elements

* updating changelog

* feat(Roster): Replace as with children in the data

* feat(Tree): Fix tree selection

* feat(Tree): Remove dead file

* adding table keyboard navigation tests

* deleting from master

* adding table keyboard navigation tests

* deleting files from master, pushed by mistaked

* feat(Tree): remove dup spread props

* feat(Tree): Revert context value prop

* Update packages/fluentui/accessibility/src/behaviors/Tree/treeItemBehavior.ts

Co-Authored-By: Roman Sudarikov <pompomon@users.noreply.github.com>

* Update packages/fluentui/react-northstar/src/components/Tree/TreeItem.tsx

Co-Authored-By: Marija Najdova <mnajdova@gmail.com>

* Update packages/fluentui/react-northstar/src/components/Tree/TreeTitle.tsx

Co-Authored-By: Marija Najdova <mnajdova@gmail.com>

* Update packages/fluentui/react-northstar/src/themes/teams/components/Tree/treeTitleVariables.ts

Co-Authored-By: Marija Najdova <mnajdova@gmail.com>

* Update packages/fluentui/accessibility/src/behaviors/Tree/treeTitleBehavior.ts

Co-Authored-By: Oleksandr Fediashov <alexander.mcgarret@gmail.com>

* Update packages/fluentui/react-northstar/src/components/Tree/Tree.tsx

Co-Authored-By: Oleksandr Fediashov <alexander.mcgarret@gmail.com>

* Update packages/fluentui/react-northstar/src/components/Tree/TreeItem.tsx

Co-Authored-By: Oleksandr Fediashov <alexander.mcgarret@gmail.com>

* feat(Tree): Temp removing option to pass a custom checkbox to the selectable tree

* Update packages/fluentui/docs/src/examples/components/Tree/Usage/TreeMultiselectExample.shorthand.tsx

Co-Authored-By: Oleksandr Fediashov <alexander.mcgarret@gmail.com>

* feat(Tree): Reduce over forEach

* feat(Tree): Typo

* Update packages/fluentui/accessibility/test/behaviors/treeTitleBehavior-test.tsx

Co-Authored-By: Roman Sudarikov <pompomon@users.noreply.github.com>

* feat(Tree): Enable select all nested children

* feat(Tree): Fix select on right click

* feat(Tree): Reverting non-related file

* feat(Tree): Fix tree title behavior tests

* feat(Tree): Fix behavior test for subTree

* feat(Tree): Outline treetitle as block  when selectable

* feat(Tree): Custom Select Indicator

* feat(Tree): Remove focus from custom checkbox

* feat(Tree): fix select all

* removing rtl types and fix if condition for not selectable item

* adding example that will handle custom selectable parent and default

* adding methods to check if all or some of children of a groups has been selected

* handling incompleted group selected

* adding icon for 3rd checkbox state

* feat(Tree): Improve determinated state for selectable parent

* feat(Tree): enable toggle parent select using keyboard

* feat(Tree): indeterminated state url file

* chore(treeTitleVariables): remove lodash

* feat(Tree): border color

* feat(Tree): add step

* feat(Tree): Remove Dup File

* feat(Tree): Right condition

* feat(Tree): Adapt example

* feat(Tree): Fix behavior test

* feat(Tree): Toggle multiselection

* feat(Tree): Toggle multiselection

* feat(Tree): Remove keyboard import

* feat(Tree): Fix conditions

* feat(Tree): Fix test behaviors

* feat(Tree): Remove select on enter

* feat(Tree): Active items test

* feat(Tree): Space select screenshot

* feat(Tree): Review changes

* feat(Tree): Fix test

* feat(Tree): remove log

* feat(Tree): steps

* fix(Dropdown): don't clear value on same item selection (microsoft#12784)

* fix same item selection

* improve the unit test

* changelog

* improve code

* hide/unhide legends (microsoft#12469)

* adding new prop hideLegend in donut chart and line chart which decides to show or hide legends

* Change files

Co-authored-by: v-sivsar <v-sivsar@microsoft.com>

* User/v sivsar/linchart line click (microsoft#12548)

* adding onclick to the line in the line chart

* Change files

Co-authored-by: v-sivsar <v-sivsar@microsoft.com>

* chore(TableRow): Convert to FC (microsoft#12797)

* Convert TableRow to FC

* Update Changlelog

* Fix imports

* Apply suggestions from code review

Co-Authored-By: Marija Najdova <mnajdova@gmail.com>

* Add TableRow onClick to handled props

* Properly add onClick to handledProps

Co-authored-by: Marija Najdova <mnajdova@gmail.com>

* FocusZone: Adding preventDefaultWhenHandled to v7 version (microsoft#12636)

#### Pull request checklist

- [ ] Addresses an existing issue: Fixes #0000
- [x] Include a change request file using `$ yarn change`

#### Description of changes

This PR brings the `preventDefaultWhenHandled` prop from the v0 version of `FocusZone` to the v7 version. This prop, if true, prevents the default behavior of focus events.

#### Focus areas to test

(optional)

* FocusZone: Updating comment for preventDefaultWhenHandled prop (microsoft#12830)

#### Pull request checklist

- [ ] Addresses an existing issue: Fixes #0000
- [x] Include a change request file using `$ yarn change`

#### Description of changes

`FocusZone`: Updating comment for `preventDefaultWhenHandled` prop to be consistent across both versions.

#### Focus areas to test

(optional)

* feature: improve `compose()` signature (microsoft#12745)

* feat: compose sig

* wip

* bump api

* -cleanup

* -changed compose tests

* -fixed any

* -fixed screener regressions

* -fixed build issues
-fixed screener

* Update packages/react-compose/src/types.ts

Co-Authored-By: Oleksandr Fediashov <olfedias@microsoft.com>

* fix types in ButtonContent

* -update api

* -test updates

* -ts fixes

* -added shorthandConfig in Button component

* -fixed compose test

* -fix

* Update packages/fluentui/react-northstar/src/components/Box/Box.tsx

Co-Authored-By: Roman Sudarikov <pompomon@users.noreply.github.com>

* Update packages/fluentui/react-northstar/src/components/Button/Button.tsx

Co-Authored-By: Roman Sudarikov <pompomon@users.noreply.github.com>

* fixes

* wip

* fix RefForward to handle `innerRef` changes

* reverted Accordion changes

* -tslint disable

* -screener diff

* -testing

* -reverted changes

* -better description

* fix build

* changelog entry

* Update packages/fluentui/CHANGELOG.md

Co-Authored-By: Oleksandr Fediashov <olfedias@microsoft.com>

Co-authored-by: Marija Najdova <mnajdova@gmail.com>
Co-authored-by: Roman Sudarikov <pompomon@users.noreply.github.com>

* applying package updates

* Callout: Updating positioning logic to account for dual screen scenarios (microsoft#12785)

#### Pull request checklist

- [ ] Addresses an existing issue: Fixes #0000
- [x] Include a change request file using `$ yarn change`

#### Description of changes

This PR updates the positioning logic in the `Callout` component to make it dual-screen aware using the new `windowSegments` API. Components using `Callout` underneath such as `ContextualMenu` are also updated.

This PR also adds a bunch of unit tests checking that the correct bounds for the screen segments are being calculated.

__Before:__
![Before](https://user-images.githubusercontent.com/7798177/79797849-dd11d100-830c-11ea-8303-c1147d8f0f79.gif)

__After:__
![After](https://user-images.githubusercontent.com/7798177/79797858-e13dee80-830c-11ea-8acc-6df9f44148cd.gif)

#### Focus areas to test

* feat(Tree): steps

Co-authored-by: Michal <michal.frdlik@hotmail.com>
Co-authored-by: Milan Turon <mituron@microsoft.com>
Co-authored-by: Milan Turon <milanturon@centrum.cz>
Co-authored-by: Charles Assuncao <chassunc@microsoft.com>
Co-authored-by: Roman Sudarikov <pompomon@users.noreply.github.com>
Co-authored-by: Marija Najdova <mnajdova@gmail.com>
Co-authored-by: Oleksandr Fediashov <alexander.mcgarret@gmail.com>
Co-authored-by: Charles Assuncao <charles.assuncao@microsoft.com>
Co-authored-by: Silviu Alexandru Avram <silviu.avram91@gmail.com>
Co-authored-by: shivasai09 <33802398+shivasai09@users.noreply.github.com>
Co-authored-by: v-sivsar <v-sivsar@microsoft.com>
Co-authored-by: Makoto Morimoto <humbertomakotomorimoto@gmail.com>
Co-authored-by: Oleksandr Fediashov <olfedias@microsoft.com>
Co-authored-by: Fluent UI Build <fluentui-internal@service.microsoft.com>
miroslavstastny pushed a commit that referenced this pull request May 13, 2020
* fix same item selection

* improve the unit test

* changelog

* improve code

(cherry picked from commit 3b8eec1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fluent UI react-northstar (v0) Work related to Fluent UI V0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants