Skip to content

refactor!: Use --lumo-clickable-cursor for clickable elements - #2114

Merged
web-padawan merged 4 commits into
masterfrom
lumo-clickable-cursor
Jul 6, 2021
Merged

web-padawan merged 4 commits into
masterfrom
lumo-clickable-cursor

Conversation

@jouni

@jouni jouni commented Jun 15, 2021 •

Copy link
Copy Markdown
Member

Use the --lumo-clickable-cursor property consistently across all components, so that it can be used by custom themes to easily change the default.

This changes the default for Tabs and Grid sorter.

Note: links are excluded, they should always use cursor: pointer;

@jouni

jouni commented Jun 15, 2021 •

Copy link
Copy Markdown
Member Author

I’m not sure the Grid sorter "should be clickable" test is meaningful. Checking for the cursor property doesn't make it clickable. I think I would remove this test.

it('should be clickable', () => {
  const title = sorterFirst.querySelector('.title');
  expect(window.getComputedStyle(title).cursor).to.equal('pointer');
});

I removed it tentatively. Let me know if it can and should be tested in some more meaningful way. To me it feels the "clickability" is being tested with, for example, the following:

    it('should toggle direction', () => {
      click(sorter);
      expect(sorter.direction).to.equal('asc');
      click(sorter);
      expect(sorter.direction).to.equal('desc');
      click(sorter);
      expect(sorter.direction).to.equal(null);
    });

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@web-padawan web-padawan changed the title fix(lumo): Use --lumo-clickable-cursor for clickable elements refactor!: Use --lumo-clickable-cursor for clickable elements Jul 6, 2021

@web-padawan web-padawan left a comment

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.

LGTM.

This can be considered a fix because we already have a documentation for this API
https://vaadin.com/docs/latest/ds/foundation/interaction/#clickable-cursor
But I have changed the PR title to be refactor because this does not fix any bug or BFP.

IMO it's ok to merge it now while Vaadin 21 is still in alpha stage.

@web-padawan
web-padawan merged commit a899468 into master Jul 6, 2021
@web-padawan
web-padawan deleted the lumo-clickable-cursor branch July 6, 2021 11:53
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.

2 participants