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

feat: upgrade fundamental-styles to 0.11.0-rc.4 #1082

Merged
merged 14 commits into from
Jun 8, 2020
Merged

feat: upgrade fundamental-styles to 0.11.0-rc.4 #1082

merged 14 commits into from
Jun 8, 2020

Conversation

jbadan
Copy link
Contributor

@jbadan jbadan commented Jun 3, 2020

Description

BREAKING CHANGES:

  • Panel: renamed LayoutPanel
  • Select: underlying html changes
  • StepInput: underlying html changes
  • Tile: removed active prop
  • Tile: onClick prop now required - all tiles are clickable by default
  • Tile: removed productTile prop
  • Tile: removed tabIndex prop (no longer necessary because they are always buttons now)
  • Tile.Actions removed
  • Tile.Media removed
  • Tile.Content no longer takes a title prop - this should now be added as a child to Tile.Header
  • Tile.Content: removed headingLevel prop
  • Tile.Content: removed titleProps prop
  • Tile.Content: removed productTile prop
  • Tile.Content: underlying html changes related to removal of title

Features:

  • List.Item: add selected state
  • Select: keyboard handling + focus handling
  • StepInput: new compact state
  • Tile: new isDouble prop (this is a bad name Help!) - maxes tile 2x1
  • Tile: new size prop
  • Tile.Header: new subcomponent
  • Tile.Footer: new subcomponent
  • Tile.Content: new twoColumns prop - enabled Content to be split into 2 columns

Fixes:

  • fix Popover styling issues on docs site

fixes #1071

@jbadan jbadan changed the title Fix/fs feat: upgrade fundamental-styles to 0.11.0-rc.4 Jun 3, 2020
@netlify
Copy link

netlify bot commented Jun 3, 2020

Deploy preview for fundamental-react ready!

Built with commit c8143af

https://deploy-preview-1082--fundamental-react.netlify.app

LayoutPanel.Filters = LayoutPanelFilters;
LayoutPanel.Footer = LayoutPanelFooter;
LayoutPanel.Head = LayoutPanelHead;
LayoutPanel.Header = LayoutPanelHeader;
Copy link
Contributor Author

@jbadan jbadan Jun 3, 2020

Choose a reason for hiding this comment

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

I've exported something wrong in layout panel but I can't figure out what found it

@@ -51,7 +51,7 @@ describe('<Select />', () => {
});
});

test('forwards the ref to the button', () => {
xtest('forwards the ref to the div role="button"', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@skvale I've done something wrong with how to handle forwarding the ref in Select - could you take a look when you get some time?

Copy link
Contributor

Choose a reason for hiding this comment

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

Popover is overriding the ref prop of this control element

        let controlProps = {
            onClick: onClickFunctions,
            ref: (c) => {
                this.controlRef = findDOMNode(c);
            }
        };

I'll see if there's way to extend the ref, but still maintain the original ref somehow

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need to do something like this in Popover

let controlProps = {
    onClick: onClickFunctions,
    ref: (c) => {
        this.controlRef = findDOMNode(c);
        if (typeof control.ref === 'function') {
            control.ref(c);
        } else if (typeof control.ref === 'object') {
            control.ref.current = c;
        }
    }
};

@jbadan jbadan requested a review from a team June 4, 2020 14:10
require('fundamental-styles/dist/select.css');
}
}, []);

const divRef = ref ? ref : useRef(null);
Copy link
Contributor

@skvale skvale Jun 5, 2020

Choose a reason for hiding this comment

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

We shouldn't conditionally call a hook

const internalDivRef = useRef(null);
const divRef = ref || internalDivRef;

@jbadan jbadan requested a review from a team June 5, 2020 19:52
'is-disabled': disabled,
'is-readonly': readOnly,
[`is-${validationState?.state}`]: validationState ?.state
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder why eslint doesn't pick up on this line having an extra space validationState ?.state

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure - good catch though!

case 'space':
e.stopPropagation();
handleSelect(e, option);
setFocusedElement(tryFocus(divRef.current));
Copy link
Contributor

@skvale skvale Jun 5, 2020

Choose a reason for hiding this comment

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

It looks like the intent of the enter and space is to close the select. This isn't happening.

For some reason it is calling the handleClick immediately after the handleSelect and the handleClick is toggling the isExpanded state back to true

Copy link
Contributor

Choose a reason for hiding this comment

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

It works as expected if you call e.preventDefualt(); though

@@ -1,60 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Storyshots Visual Button Group 1`] = `
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was a duplicate of the same storyshot below

@jbadan jbadan requested a review from a team June 8, 2020 14:13
Copy link
Contributor

@skvale skvale left a comment

Choose a reason for hiding this comment

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

LGTM

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.

Popover: styling is incorrect on docs site
2 participants