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

Add tooltipAccessor prop to calendar to disable tooltip if needed #701

Merged
merged 2 commits into from
Feb 5, 2018

Conversation

ginifizz
Copy link
Contributor

@ginifizz ginifizz commented Jan 23, 2018

Use a "tooltipAccessor" prop for the tooltip instead of the "titleAccessor" prop. Can show a tooltip different from the title, or not display it at all if the accessor returns null.

Fixes #226, #470

src/DayColumn.js Outdated
title:
(typeof label === 'string' ? label + ': ' : '') + tooltip,
}
: {})}
Copy link
Owner

Choose a reason for hiding this comment

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

lets make this a bit less ugly please :P i'd just set title to undefined in the one case that will be fine

src/EventCell.js Outdated
@@ -75,7 +78,7 @@ class EventCell extends React.Component {
onClick={e => onSelect(event, e)}
onDoubleClick={e => onDoubleClick(event, e)}
>
<div className="rbc-event-content" title={title}>
<div className="rbc-event-content" {...tooltip ? { title: tooltip } : {}}>
Copy link
Owner

Choose a reason for hiding this comment

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

ditto here

@jquense jquense merged commit 9c9490f into jquense:master Feb 5, 2018
@jquense
Copy link
Owner

jquense commented Feb 5, 2018

thanks!

@TheReactBeginner
Copy link

Hey, can you please let me know the ETA...

@RusselFourteen
Copy link

Can you please tell me how to off the built it Tooltip? I already tried many times but I still failed. Thanks and Sorry, newbie here

@RusselFourteen
Copy link

I already added toolTipAccessor but what is my next move? Where can I defined tooltip as undefined or null?

@ginifizz
Copy link
Contributor Author

ginifizz commented Mar 2, 2018

@RusselFourteen It works like the others accessors. Assign a function who returns NULL to the tooltipAccessor and it will be removed.
Like this :
<Calendar tooltipAccessor={() => null} ... />

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.

4 participants