Repository navigation
refactor!: Use --lumo-clickable-cursor for clickable elements - #2114
Conversation
|
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);
}); |
|
Kudos, SonarCloud Quality Gate passed!
|
--lumo-clickable-cursor for clickable elements--lumo-clickable-cursor for clickable elements
web-padawan
left a comment
There was a problem hiding this comment.
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.
Use the
--lumo-clickable-cursorproperty 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;