How to catch 'hide.bs.tab' event for tabs in React-Bootstrap -


due docs react-bootstrap supports onselect method tabs fires once tab switch tab. looking similar native twitter bootstrap event hide.bs.tab determine moment when tab starts closing.

i found utilities onexit method, doesn't work tabs, me.

how that?

actually, onselect fires (if provided prop) tab selected, not after switched to. handler's job switch active tab (or not), perhaps after loading additional information through wire, , on.

an excerpt react-bootstrap code:

if (this.props.onselect) {   this._ischanging = true;   this.props.onselect(selectedkey);   this._ischanging = false;   return; } 

(taken https://github.com/react-bootstrap/react-bootstrap/blob/44182b72da816b719029355478ef2e7efef522f6/src/tabs.js#l324)

then followed built-in tab switching if hadn't provided onselect.

for example, custom onselect handler display spinner, fetch data goes in new tab, , once that's done hide spinner , switch active tab one, using activekey prop.


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -