-
-
Notifications
You must be signed in to change notification settings - Fork 333
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
Feature/paper menu #140
Feature/paper menu #140
Conversation
@peec any idea when this might be merged? could really use the awesome select menu you created. great work! |
@jamesdixon I'm not sure when, but #138 needs to be merged first (which is good to be merged in my eyes). When #138 is merged I will update this PR to conform with the new changes and relying on ember-css-transitions like #138 does. @miguelcobain Maybe Miguel can answer this. Do you have any plans of when to review / merge #138 ? |
bumpo progressing. progressing ... Starting to get somewhere. resuable components for menu / select etc. md-select (not finished). Implement the select custom animation. Remove the need of a wrapper inside menu component. Support optgroups wire events for selects, add async select with progress. lint + optional to turn off cache on async select. Small additions to select, support disable Use correct class if placeholder is active. Move click open to container itself Start refactoring, move menu based features to menu, the rest is considered to be abstract for all 'menu' based components. This cleans up some wierd code within the first component (paper-select) and (paper-menu). Rewamp menues docs and add border-box to prism override so the box does not break layout. Resolve label issue in select when change of route instead pass it directly and not from the promise. Document paper-select. The power of to='inverse' makes menu component much simpler. Use spans around text in paper-menu-item. Code style. Add deps
038d693
to
76acd25
Compare
@peec thanks! Would it be OK to work off of your fork in the meantime? I just need to get something roughed out, so doesn't need to be perfect. |
@jamesdixon Yes, that is no problem :) I have started some cleanups now on this PR so that it will be ready when #138 is on master. |
@peec awesome! which branch should i pull from in order to obtain the select functionality? |
@peec nevermind. glossed over it -- |
@peec implemented your branch and things are looking great! Had a quick question to see if you had planned on supporting the placeholder transforming to a label after an option has been selected on the select menu? Also curious if it's trivial for the focused state to change the color of the line on the select menu to match the highlight of the other forms? Thank you! |
@jamesdixon I will take a look at that, thanks for testing so we can fix this before final merge 👍 |
@peec no problem! appreciate you developing this component! Also, I did have an alignment issue out of the box: Here's the associated HTML code, which is part of a standard 3-column bootstrap setup: <div class="col-sm-3">
<md-select id="ember738" tabindex="0" class="ember-view md-default-theme">
<md-select-value id="ember747" class="ember-view md-select-value md-select-placeholder">
<span>State</span>
<span class="md-select-icon" aria-hidden="true"></span>
</md-select-value>
</md-select>
</div> As far as I can see, the only styling applied is this from the Ember Paper stylesheet: md-select {
display: flex;
margin: 20px 0 26px 0;
margin-top: 20px;
margin-right: 0px;
margin-bottom: 26px;
margin-left: 0px;
} Cheers, |
@jamesdixon Regarding alignment: I think the reason is you would have to use standard angular grid system here and wrap the inputs in See https://github.com/peec/ember-paper/blob/feature/paper-menu/tests/dummy/app/templates/paper-select.hbs where all inputs are in a Edit: |
@peec much appreciated! I didn't realize that ember-paper also implemented its own grid system. Thank you! |
So, is there something missing in this PR, @peec? |
@peec hate to bother you again, but I'm attempting to actually load data into the select menu and am running into an issue. I've followed the public API as you mentioned above, but unfortunately, it appears the select is rendering only a single item, which is just a string of objects. It ends up looking like this: and generates the following output: <md-select id="ember634" tabindex="0" class="ember-view md-default-theme">
<md-select-value id="ember643" class="ember-view md-select-value">
<span>[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object
Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object
Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object
Object],[object Object],[object Object],[object Object]</span>
<span class="md-select-icon" aria-hidden="true"></span>
</md-select-value>
</md-select> The code I'm using is the following: {{#paper-select placeholder=(t 'forms.address.state') model=usStates.states}}
{{#each state as |s|}}
{{#paper-option value=s.abbrev}}
{{s.name}}
{{/paper-option}}
{{/each}}
{{/paper-select}} Where [{ name: 'Colorado', abbrev: 'CO' }, ...] Just to test to make sure nothing was incorrect with my data, I switched it to an If there is something fundamentally wrong with my approach or the format of the data, please let me know. Also, on separate note, it appears the website where your demo lives periodically goes down throughout the day. Wasn't sure if it was on a VM or something that shuts down during specific times to save money. Thank you and please let me know if there's anything I can do to assist. Best, |
@jamesdixon I see that states is passed to the model, the model attribute is the selected model (and not list of model). I think you want to have something like this: {{#paper-select placeholder=(t 'forms.address.state') model=selectedState}}
{{#each usStates.states as |s|}}
{{#paper-option value=s.abbrev}}
{{s.name}}
{{/paper-option}}
{{/each}}
{{/paper-select}} |
@miguelcobain I'll go through the PR now, and check if anything is missing, but this should be very near complete after much refactoring earlier. |
…ch makes it compatible with paper-input. Uses paper-input has base.
@miguelcobain I refactored code style, and fixed wrap in md-input-container so that labels works correctly also for select (pops above) when has value. This should be ready now. |
@peec thank you! I knew it was something dumb I was doing. The param being called model was throwing me off. I was thinking that it was the model containing all of the states. Wondering if maybe that param should be renamed to |
@peec - it appears I may have spoken too soon. Using the code you provided above, I receive the following error when clicking on the select menu:
When digging into the HTML, the list of options is still not rendered. I did pull down your latest commit, but unfortunately, it did not have any effect. Sorry to be a pest, but not sure where to go from here. I did ensure that the list of states is accessible by doing a standard Thank you! |
Regarding wormhole, some commits ago I changed to using wormhole - check 29. aug. 2015 19.15 skrev "jamesdixon" notifications@github.com:
|
Thanks, @peec. That also remedied my issue with the states not displaying. There is still an alignment issue. I noticed that you had made a commit to wrap the select in md-input-container:not(.md-input-has-value) .md-select-value {
padding-top: 26px;
} |
@peec I didn't see it the demo, but wanted to ask if there was support for validation on selects? |
@peec hi again. I've confirmed that there is no way to display an error message or use validation at this point. I attempted to implement it myself, but I'm having trouble finding some sort of hook that is called when the menu is dismissed. My thinking was that validation should only be performed once the menu is open and then dismissed. Any thought or suggestions on this? I know you're busy, so I'd love to contribute. Thanks! |
@peec one other thing I noticed is that the select will display the list of items properly, but after choosing an item, the select displays the value of the selected item rather than displaying the label of the item. |
Implement paper menu and select component
Implementation:
Features:
Menues
Current public api for component (in its simplest way):
Select