rsschermer / ember-rl-dropdown Goto Github PK
View Code? Open in Web Editor NEWDropdown components and mixin for Ember.
License: MIT License
Dropdown components and mixin for Ember.
License: MIT License
It would be helpful to have an is-expanded
class present on the dropdown-container when it's expanded. That way you could define styles for when the dropdown is expanded (for example, updating a toggle icon).
Same thing for the template:
{{#rl-dropdown-toggle-expanded}}
{{! expanded icon }}
{{/rl-dropdown-toggle-expanded}}
{{#rl-dropdown-toggle-collapsed}}
{{! collapsed icon }}
{{/rl-dropdown-toggle-collapsed}}
Or something similar.
toggleDropdown action isn't received in rl-dropdown-container, so the dropdown won't open.
Unconsumed actions don't throw any error in components, so I'm not sure where it ends. In the meantime, I've made it work by replacing this.sendAction(); in rl-dropdown-toggle.js with manually toggling the dropdownExpanded property on parentView. That at least allows me to open dropdowns, but leaves other problems (navigating away from current route with expanded dropdown keeps dropdownExpanded enabled for all dropdowns everywhere else in the application etc.). Not sure if the problem is in new Ember, e-r-d or my workaround.
What the problem is?
Have a DOM (with class rl-dropdown-toggle) that sets the "dropdownExpanded" property to true on click. This property will be used in the dropdown DOM (rl-dropdown). I set this property through a service and have it synced two way via Ember.computed.alias(). As a result this property is set, and reset again, due to the "clickoutHandler" method. The IF condition seems to not work and I have to explicitly overwrite this method.
if(component.get('dropdownExpanded') && $target.closest('html').length !== 0 &&
!($target.closest($c.find(component.get('dropdownToggleSelector'))).length ||
$target.closest($c.find(component.get('dropdownSelector'))).length)
)
Instead of saying $target.closest having a length > 0, we could use $target.is(component.get('dropdownSelector')) and $target.is(component.get('dropdownToggleSelector') thereby causing the clickoutHandler method to function properly.
Upgraded to ember 2.18.0 and started to get this warning.
DEPRECATION: An addon is trying to access project.nodeModulesPath. This is not a reliable way to discover npm modules. Instead, consider doing: require("resolve").sync(something, { basedir: project.root }). Accessed from: new NPMDependencyVersionChecker (node_modules\ember-rl-dropdown\node_modules\ember-cli-version-checker\src\npm-dependency-version-checker.js:11:33)
ember-cli: 2.18.0
node: 8.9.4
os: win32 x64
I noticed this component doesn't manage keyboard events, like going up and down the dropdown with the keyboard arrows for example.
Are you planning on adding support for that? I might be able to open up a PR if you're okay with that.
I am having problems with checking checkbox with ember 1.11.3.
It happened after updating from 0.2.1 to 0.2.2
This is directly from readme, only changed link to a checkbox.
This must be related with the click event that was changed in 0.2.2
{{#rl-dropdown-container class="dropdown"}}
{{#rl-dropdown-toggle class="btn btn-default"}}
Toggle <span class="caret"></span>
{{/rl-dropdown-toggle}}
{{#rl-dropdown tagName="ul" class="dropdown-menu" closeOnChildClick="a:link"}}
{{input type="checkbox" checked=checked}}
{{/rl-dropdown}}
{{/rl-dropdown-container}}
Cheers!
I wanted to put a file upload label in my dropdown list
{{#rl-dropdown tagName="ul"}}
<li class='rl-dropdown-item'>
<label>
Upload new video
<input type="file" style="visibility: hidden">
</label>
</li>
...
but this wasn't working because rl-dropdown
doesn't propagate events. I had to copy + paste rl-dropdown
into my project + remove this line to get it working.
Do you recall why?
When using the jquery-migrate tool for jQuery 3, ember-rl-dropdown is triggering deprecation warnings for .bind() and .unbind():
A description of the warnings: https://github.com/jquery/jquery-migrate/blob/master/warnings.md#jqmigrate-jqueryfnbind-is-deprecated
class="{{ if isGradeNotSelected 'disabled' }}" will render class="{{ if isGradeNotSelected 'disabled' }}
Clean install, ran ember test
, getting 5 failures.
Thanks for this great addon!
Clicking outside of an expanded dropdown closes it, but tapping (chrome, iOS) doesn't. Have you encountered this before, or is it a bug?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.