Comments (9)
@rulyotano because inputs aren't supported in dropdown menus. The current API though does allow you make a custom menu that does support it
from react-bootstrap.
Hmm, I think this is the same behaviour as the Bootstrap component. I'm not sure we should change it. I think your workaround is reasonable.
You could just add one handler to the form like: <form onClick={this.killClick} />
.
from react-bootstrap.
Yes.. it is.. the way they handle it is a jquery hack to be honest. The problem I am facing is adding onClick to the is being ignored. When I click on the input box that shows up in the drop down, nothing happens. onFocus works though... but it doesn't prevent the pop-down menu from disappearing as soon as I click on the input box. I'll try putting it on the form element, see if that helps.
On Tuesday, April 8, 2014 7:18 AM, Stephen J. Collings [email protected] wrote:
Hmm, I think this is the same behaviour as the Bootstrap component. I'm not sure we should change it. I think your workaround is reasonable.
You could just add one handle to the form like:
β
Reply to this email directly or view it on GitHub.
from react-bootstrap.
Ah, ok, I think I misunderstood. I'll look into this.
from react-bootstrap.
Sorry, just got round to looking at this. So at the moment it's expected that children are MenuItem
s. If you wrap your form in a MenuItem
the handler will fire but you'll have an unwanted anchor in your markup that you could work around with CSS.
I think we should support your use case by rendering a div
instead of a ul
if the children aren't MenuItem
s.
from react-bootstrap.
I looked into this issue, and was unable to reproduce. It appears that the click behavior of the DropdownButton component was addressed in #86.
<ul className="nav navbar-nav navbar-right">
<li>
<ButtonToolbar>
<DropdownButton bsStyle='default' bsSize='large' title='Login' onClick={ this.handleClick }>
<form id="loginForm" accept-charset="UTF-8">
<input id="login_username" style={inputStyle} onClick={this.inputClick} type="text" name="username" placeholder="Username" size="30" />
<input id="login_password" style={inputStyle} onClick={this.inputClick} type="password" name="password" placeholder="Password" size="30" />
<button type="button" className="btn btn-primary" onClick={this.login} style={inputStyle}>Login</button>
</form>
</DropdownButton>
</ButtonToolbar>
</li>
</ul>
with click handlers:
handleClick(e) {
console.log('handleClick');
};
inputClick(e) {
e.stopPropagation();
};
The input click handler was triggered, and the event did not propagate up to the DropdownButton.
from react-bootstrap.
@hedgerh Thank you! Closing this issue for now, then, especially with the dropdown rework.
from react-bootstrap.
Why is this is closed?? I still getting the same issue/error!
from react-bootstrap.
Ok, so the solution is creating your own drop down, and handle a lot of things that custom drop down doesn't, like closing on click out. What is the reason why inputs are not supported! Thanks for answering.
from react-bootstrap.
Related Issues (20)
- null is not an object (evaluating 'ye.scrollHeight') HOT 1
- Feature Select component with search HOT 1
- Bug - Page Not Found for Tabs Doc Site HOT 3
- Dropdown should overlay the parent container HOT 1
- Alignment of button text in grid changes if href tag is set HOT 1
- Feature Request: Custom Anchor element for PageItem
- Button is not responsive inside the MODAL HOT 3
- defaultActiveKey and alwaysOpen not working properly at the same time HOT 1
- Error using components HOT 1
- NextJS <Link> giving error with react-bootstrap <Navbar.Link> HOT 1
- Docs - Components props tables are missing
- Tabs Component doesn't pass id attribute to underlying element HOT 1
- aria-label for DropdownButton HOT 2
- React Bootstrap doesn't let me set background color HOT 1
- Bug: OverlayTrigger doesn't hide after modal close. HOT 5
- Rendering children (Accordion) HOT 1
- Modal component stop working when closed HOT 6
- Keyboard input Tab + Shift escapes Modal's focus HOT 3
- ESC and Up/Down in Dropdown doesn't work when using the native Bootstrap HOT 2
- Suggest adding 'use clientβ for all the react-bootstrap component HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-bootstrap.