Black Lives Matter. Please consider donating to Black Girls Code today.

Dash Interval Page Title Updating

When using Dash interval to update a live page, every time new data is loaded the page title changes to “Updating…” and then back. How can I go about turning this off or making the page title static? It’s annoying to the point I don’t want to build a dashboard using Dash interval unless I can turn it off.

2 Likes

There is an issue for this topic on Github: https://github.com/plotly/dash/issues/732. Actually commenting the section in DocumentTitle.react.js does the trick. But I would rather like to introduce an config parameter for the main dash-object allowing to change the loading title or setting it to None which would omit changing title on loading all together.

DocumentTitle.react.js

import {connect} from 'react-redux';
import {Component} from 'react';
import PropTypes from 'prop-types';

class DocumentTitle extends Component {
    constructor(props) {
        super(props);
        this.state = {
            initialTitle: document.title,
        };
    }

    UNSAFE_componentWillReceiveProps(props) {
        if (props.pendingCallbacks.length) {
            document.title = 'Updating...';
        } else {
            document.title = this.state.initialTitle;
        }
    }

    shouldComponentUpdate() {
        return false;
    }

    render() {
        return null;
    }
}

It’s a good idea! We would accept a PR that did this, feel free to make this contribution.

Great, happy to hear you would accept such a feature. I’m on vacation right now but I‘ll look into it in two weeks.

I created a PR for this issue introducing an update_title parameter that can be a String or None. It defaults to “Updating…”. If set to None the document title will not be changed during updates. https://github.com/plotly/dash/pull/1315

3 Likes

The PR addressing this issue has been merged in the dev branch with this commit. It should be available with the next release which I guess will be 1.13.5

1 Like

Many thanks to @stlehmann! This is feature is now available in dash==1.14.0 (📣 Dash v1.14.0 Released - Update the Tab's Title, Removing the "Updating..." Messages, Updated DataTable Link Behavior) and is documented in http://dash.plotly.com/external-resources. Look for the title= and update_title= . See the “Customizing Dash’s Document or Browser Tab Title”, " Update the Document Title Dynamically based off of the URL or Tab", and “Customizing or Removing Dash’s “Updating…” Message” sections.

1 Like