mirror of
https://github.com/yewprint/yewprint
synced 2024-11-25 13:00:19 +00:00
Fixed <Tag>'s remove button not colliding with right icon (#48)
Fixes #46
This commit is contained in:
parent
58933276c9
commit
69e271f565
1 changed files with 5 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
||||||
use crate::{if_html, Button, ConditionalClass, Icon, IconName, Intent, Text};
|
use crate::{if_html, ConditionalClass, Icon, IconName, Intent, Text};
|
||||||
use yew::prelude::*;
|
use yew::prelude::*;
|
||||||
|
|
||||||
pub struct Tag {
|
pub struct Tag {
|
||||||
|
@ -67,12 +67,13 @@ impl Component for Tag {
|
||||||
let remove_button = if_html! {
|
let remove_button = if_html! {
|
||||||
let Some(callback) = self.props.onremove.clone() =>
|
let Some(callback) = self.props.onremove.clone() =>
|
||||||
html!(
|
html!(
|
||||||
<Button
|
<button
|
||||||
class="bp3-tag-remove"
|
class="bp3-tag-remove"
|
||||||
onclick={callback}
|
onclick={callback}
|
||||||
|
tabindex?={self.props.interactive.map_some(0)}
|
||||||
>
|
>
|
||||||
<Icon icon=IconName::SmallCross />
|
<Icon icon=IconName::SmallCross />
|
||||||
</Button>
|
</button>
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -99,8 +100,8 @@ impl Component for Tag {
|
||||||
>
|
>
|
||||||
{self.props.children.clone()}
|
{self.props.children.clone()}
|
||||||
</Text>
|
</Text>
|
||||||
{remove_button}
|
|
||||||
{right_icon}
|
{right_icon}
|
||||||
|
{remove_button}
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue