-
-
Notifications
You must be signed in to change notification settings - Fork 361
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 NeoSelect #6200
Feature NeoSelect #6200
Conversation
✅ Deploy Preview for koda-canary ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
AI-Generated Summary: This pull request includes two patches:
|
Also I’ve noticed that I forgot to change other references to select component 😆 my Mac is dead so will fix later |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: roiLeo <medina.leo42@gmail.com>
@prury not sure about the extra options in balance input, but the problem with unclickable arrow is problem in oruga library as there is no handler for the custom icons |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
</template> | ||
|
||
<script lang="ts" setup> | ||
import { OField, OSelect } from '@oruga-ui/oruga' | ||
<script setup> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any concern if we using mixins instead here? should be easier to migrate b-select
, and the test should be ok
<script>
import { OSelect } from '@oruga-ui/oruga'
export default {
mixins: [OSelect],
computed: {
rootClasses() {
return [
'neo-select',
this.computedClass('rootClass', 'o-ctrl-sel'),
{ [this.computedClass('expandedClass', 'o-ctrl-sel--expanded')]: this.expanded },
]
},
},
}
</script>
<style lang="scss">
@import './NeoSelect.scss';
</style>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clicking at the arrow wont open the dropdown: (General)
I don't have this issue with extending OSelect
components
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are selectClasses
imported too?
I'm ok with that but will #6200 (comment) still work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clicking at the arrow wont open the dropdown: (General)
I don't have this issue with extending
OSelect
components
Check darkmode custom arrow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But did u use custom arrow element? because their native arrow doesn't support dark mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay but still oruga select doesnt have options prop so you would need to manually add options everywhere, but my solution provides prop to set options with provided array and arrow from mixin doesnt work in dark mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay but still oruga select doesnt have options prop so you would need to manually add options everywhere
yes, maybe this is Oruga principle to go that way https://github.com/oruga-ui/oruga/blob/develop/.github/CONTRIBUTING.md#2-lightweight-and-simple for now
arrow from mixin doesnt work in dark mode
you can add this CSS to fix the icon in dark mode. by using this, we can click the arrow to open the dropdown
.dark-mode .neo-select .o-sel-arrow {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1em' viewBox='0 0 512 512'%3E%3C!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --%3E%3Cstyle%3Esvg%7Bfill:%23ffffff%7D%3C/style%3E%3Cpath d='M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z'/%3E%3C/svg%3E");
}
.light-mode .neo-select .o-sel-arrow {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1em' viewBox='0 0 512 512'%3E%3C!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --%3E%3Cstyle%3Esvg%7Bfill:%23000000%7D%3C/style%3E%3Cpath d='M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z'/%3E%3C/svg%3E");
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay solution with arrow is nice, but the argument about oruga way of doing things… I dont know, I tried to reduce the boilerplate with my solution 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imo, if the component already exists on Oruga, just use their default behaviour first by extending their component. to make it easier, because our goal is to migrate from buefy to oruga first
if we want to introduce another behaviour or even a better solution. it's good, but we can do it after migration or put it in the other custom component. in this case, we can create separate PR and then create another component <NeoSelectOption />
with your solution
another example is that we still have b-navbar
that doesnt have an oruga component. we can copy buefy implementation, or maybe create our own component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imo, if the component already exists on Oruga, just use their default behaviour first by extending their component. to make it easier, because our goal is to migrate from buefy to oruga first
Yes we first introduce breaking changes because we missed important wrapping class (#6197)
Let's first focus on migration and then we can improve some components.
another example is that we still have
b-navbar
that doesnt have an oruga component. we can copy buefy implementation, or maybe create our own component
https://github.com/oruga-ui/theme-bulma#buefy-users "Soon" ahah but I think custom Bulma navbar is the way.
Reviewpad Report
|
So what's the current state? |
let it roll 🎢 |
Code Climate has analyzed commit 26c7163 and detected 0 issues on this pull request. View more on Code Climate. |
@vikiival I will open a new PR with changes sugested by @preschian to use mixins. It would be much cleaner to find errors in this refactor as I need to rollback multiple changes. I can get to it later today or tommorow |
Understandable ^-^ |
Thank you for your contribution to the KodaDot - One Stop Shop for Polkadot NFTs.
👇 __ Let's make a quick check before the contribution.
PR Type
Context
Before submitting pull request, please make sure:
Optional
Had issue bounty label?
Community participation