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

[IconButton] Wield IconButton OnTouchTap behavior: auto navigates to url? #568

Closed
liyichao opened this issue Apr 24, 2015 · 5 comments
Closed
Labels
bug 🐛 Something doesn't work

Comments

@liyichao
Copy link

this is a test page:

var React = require('react');

var mui = require('material-ui');

var TestTouchTap = React.createClass({
    render: function() {
        return (

            <div className='mui-app-content-canvas'>
                <mui.Dialog ref='helpDialog' title='How to debug'>
                    1. restart the computer
                </mui.Dialog>
                <mui.Paper>
                    <form>
                        <mui.IconButton iconClassName='icon-action-black icon-action-black-ic_help_black_24dp' onTouchTap={this.handleHelp}/>
                    </form>
                </mui.Paper>
            </div>
        );
    },
    handleHelp: function(e) {
        e.preventDefault();
        console.log("handleHelp");
        this.refs.helpDialog.show();
    },
});

module.exports = TestTouchTap;

Modify the iconClassName as needed.

Assume the page has url localhost:8000/test. When I click the button, the dialog shows, then immediately it auto navigates to localhost:8000/test? and in the console there is a log Navigated to http://localhost:8000/test?, and the dialog disappears.

When I change the event to onClick, the dialog holds as expected and there is no auto navigation.

@pomerantsev
Copy link
Contributor

It probably has something to do with #366.

@hai-cea
Copy link
Member

hai-cea commented Jun 18, 2015

@liyichao Did you try setting the IconButton type to "button" ?

@hai-cea hai-cea changed the title Wield IconButton OnTouchTap behavior: auto navigates to url? [IconButton] Wield IconButton OnTouchTap behavior: auto navigates to url? Jun 18, 2015
@alitaheri alitaheri added the bug 🐛 Something doesn't work label Dec 8, 2015
@alitaheri
Copy link
Member

@oliviertassinari I think changing the enhanced button to render span has fixed this. What do you think? I can't reproduce 😁

@oliviertassinari
Copy link
Member

I have no idea. I would just close this issue 😁.

@alitaheri
Copy link
Member

Well feel free to reopen, if it persists 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work
Projects
None yet
Development

No branches or pull requests

5 participants