Skip to content

Commit 6add4b6

Browse files
committed
Merge remote-tracking branch 'upstream/master'
# Conflicts: # src/index.js
2 parents ab9c109 + ce365fe commit 6add4b6

File tree

11 files changed

+2826
-2669
lines changed

11 files changed

+2826
-2669
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ className | data-class | String | | extra custom class, can use !importan
6767
html | data-html | Bool | true, false | `<p data-tip="<p>HTML tooltip</p>" data-html={true}></p>` or `<ReactTooltip html={true} />`
6868
delayHide | data-delay-hide | Number | | `<p data-tip="tooltip" data-delay-hide='1000'></p>` or `<ReactTooltip delayHide={1000} />`
6969
delayShow | data-delay-show | Number | | `<p data-tip="tooltip" data-delay-show='1000'></p>` or `<ReactTooltip delayShow={1000} />`
70+
delayUpdate | data-delay-update | Number | | `<p data-tip="tooltip" data-delay-update='1000'></p>` or `<ReactTooltip delayUpdate={1000} />` Sets a delay in calling getContent if the tooltip is already shown and you mouse over another target
7071
insecure | null | Bool | true, false | Whether to inject the style header into the page dynamically (violates CSP style-src but is a convenient default)
7172
border | data-border | Bool | true, false | Add one pixel white border
7273
getContent | null | Func or Array | (dataTip) => {}, [(dataTip) => {}, Interval] | Generate the tip content dynamically

example/src/index.js

+61
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,67 @@ class Test extends React.Component {
323323
</div>
324324
</pre>
325325
</div>
326+
<div className="section">
327+
<h4 className='title'>Demonstrate using mouse in tooltip. </h4>
328+
<p>Notice that the tooltip delays going away so you can get your mouse in it. You must set delayUpdate and delayHide for the tooltip to stay long enough to get your mouse over it.</p>
329+
<p className="sub-title"></p>
330+
<div className="example-jsx">
331+
<div className="block" >
332+
<a data-for='soclose' data-tip='1'>1 (❂‿❂)</a>
333+
</div>
334+
<div className="block">
335+
<a data-for='soclose' data-tip='2'>2 (❂‿❂)</a>
336+
</div>
337+
<div className="block" >
338+
<a data-for='soclose' data-tip='3'>3(❂‿❂)</a>
339+
</div>
340+
<div className="block">
341+
<a data-for='soclose' data-tip='4'>4(❂‿❂)</a>
342+
</div>
343+
<div className="block" >
344+
<a data-for='soclose' data-tip='5'>5(❂‿❂)</a>
345+
</div>
346+
<div className="block">
347+
<a data-for='soclose' data-tip='6'>6(❂‿❂)</a>
348+
</div>
349+
<div className="block" >
350+
<a data-for='soclose' data-tip='7'>7(❂‿❂)</a>
351+
</div>
352+
<div className="block">
353+
<a data-for='soclose' data-tip='8'>8(❂‿❂)</a>
354+
</div>
355+
356+
<ReactTooltip id='soclose'
357+
getContent={(dataTip) => <div><h3>This little buddy is {dataTip}</h3><p>Put mouse here</p></div> }
358+
effect='solid'
359+
delayHide={500}
360+
delayShow={500}
361+
delayUpdate={500}
362+
place={'right'}
363+
border={true}
364+
type={'light'}
365+
366+
/>
367+
</div>
368+
<br />
369+
<pre className='example-pre'>
370+
<div>
371+
<p>{"<a data-for='soclose' data-tip='sooooo cute'>(❂‿❂)</a>"}<p/>{"<a data-for='soclose' data-tip='2'>(❂‿❂)</a>..."}<p/>{
372+
"<a data-for='soclose' data-tip='really high'>(❂‿❂)</a>\n" +
373+
"<ReactTooltip id='soclose'\n" +
374+
" getContent={(dataTip) => \n"}{
375+
" <div><h3>This little buddy is {dataTip}</h3><p>Put mouse here</p></div> }\n" +
376+
" effect='solid'\n" +
377+
" delayHide={500}\n" +
378+
" delayShow={500}\n" +
379+
" delayUpdate={500}\n" +
380+
" place={'right'}\n" +
381+
" border={true}\n" +
382+
" type={'light'}"}</p>
383+
</div>
384+
</pre>
385+
</div>
386+
326387
</section>
327388
</div>
328389
)

example/src/index.scss

+12
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,18 @@ html, body{
157157
height: 0;
158158
visibility: hidden;
159159
}
160+
.block {
161+
float: left;
162+
$width: 55px;
163+
164+
a {
165+
text-align: center;
166+
width: $width;
167+
height: $width;
168+
border: 1px solid #999;
169+
border-radius: 0px
170+
}
171+
}
160172
.side {
161173
width: 50%;
162174
float: left;

0 commit comments

Comments
 (0)