fluentui
fluentui copied to clipboard
Conformance tests for triggers
Recently we had various discussions around triggers and reached the agreement on how it should work:
- No magic handling of props in triggers, props should be applied always. I.e consistently set the same attributes and props
child.propsalways win, it is user's responsibility to handle it- The exclusion from the rule are callbacks, they are merged
Another point that we could cover that contract with conformance tests and enable them for components that use the trigger pattern. For an initial implementation the following scenarios should be covered.
Props merging
Props specified by a customer always win.
function App() {
return (
<Trigger>
<button id="foo" aria-label="bar" />
</Trigger>
);
}
This should render following markup:
<button id="foo" aria-label="bar"></button>
Callback merging
Internal and user's callbacks should be merged.
function App() {
return (
<Trigger>
<button onClick={() => console.log('foo') />
</Trigger>
);
}
- internal
onClickhandler inTriggershould be called if present onClickspecified by user should be also called
This is needed as there are tests which are already copy&paste.
Because this issue has not had activity for over 150 days, we're automatically closing it for house-keeping purposes.
Still require assistance? Please, create a new issue with up-to date details.
Because this issue has not had activity for over 150 days, we're automatically closing it for house-keeping purposes.
Still require assistance? Please, create a new issue with up-to date details.
Because this issue has not had activity for over 150 days, we're automatically closing it for house-keeping purposes.
Still require assistance? Please, create a new issue with up-to date details.
Because this issue has not had activity for over 150 days, we're automatically closing it for house-keeping purposes.
Still require assistance? Please, create a new issue with up-to date details.