Is there a built in way to bind arrow keys (right, left) to the buefy pagination element? Or do I need to use the vanillaJS keyboard events?
Vue defines key modifiers
<button v-on:keyup.left="goPrevious" />
<button v-on:keyup.right="goNext" />
Related
After changing programmatically the "disabled" parameter of Material UI button the labels' color won't change on Safari. (It works for Chrome).
CodeSandbox link:
https://codesandbox.io/embed/material-demo-forked-8ly0d
According to this issue https://github.com/mui-org/material-ui/issues/26251
you need to add a prop key to your <Button> component to force it to re-render:
<Button key={`${disabled}`} disabled={disabled} />
I'm trying to use font-awesome icon inside the TabView item. I am able to use this same code elsewhere in the page and it works fine. It just wont show any icon inside the tabview.
In my main.js:
import {TNSFontIcon, fonticon} from 'nativescript-fonticon';
TNSFontIcon.debug = true;
TNSFontIcon.paths = {
'fa': './assets/css/font-awesome.css',
'ion': './ionicons.css'
};
TNSFontIcon.loadCss();
Vue.filter('fonticon', fonticon);
In App.vue:
<TabView class="tab-view" :selectedIndex="selectedIndex" androidTabsPosition="bottom">
<TabViewItem class="fa" :text="'fa-plane' | fonticon" >
<Label text="Content for Tab 1"/>
</TabViewItem>
<TabViewItem title="Tab 2">
<Label text="Content for Tab 2" #tap="pretextsTap()" />
</TabViewItem>
</TabView>
I'm using Nativescript Vue platform and couldn't find the example of using font-awesome icon inside the tabview item. In the first TabViewItem, I was trying to add fa-plane icon to see if I got it right. It didn't. I look forward to your tip.
Thanks.
Tab view items have a title property, not text.
Give :title="'fa-plane' | fonticon" a shot.
I have been struggling for the past few hours to get a button click to work. The button contains text and an SVG, when clicking on it it opens a popover component.
The popover calculates its position on the element that was clicked upon. This works when clicking on the button itself, but when clicking on the SVG inside of the button, the dimensions/offsets from the SVG are used to calculate popover position instead.
What am I looking for: a way to bubble the click on the SVG to the button, then using the event object from the button click to calculate the popover position.
How my button with events looks like right now:
<button type="button"
#click="popButtonClicked">
Go do magical stuff
<svg path="" />
</button>
I have tried playing with #click.modifiers on both the button and SVG, but to no avail.. Hope someone has the answer for me! :)
You can get the button's reference by passing the $event as a parameter to your function, and then accessing the .currentTarget of that reference:
<button type="button"
#click="popButtonClicked($event)">
Go do magical stuff
<svg path="" />
</button>
And then in your function:
popButtonClicked (event) {
console.log(event.currentTarget)
}
Working codepen: https://codepen.io/anon/pen/gdBBdz
all tabs height increase when one tab is list and scrolls in native-base
This is how it works
When you use native-base, try to put <Tabs /> outside <Content /> because makes it scrollable.
As in the docs it outside content
https://docs.nativebase.io/Components.html#tabs-def-headref
I've struggling for two days to styling components on Native Base with <StyleProvider>. I want to change background color of header and add custom style property on the button.
<Container>
<Header /> /*change backgroundColor*/
<Content>
<Button viewDetail block> /*add 'viewDetail' as custom style property */
<Text>Button</Text>
</Button>
</Content>
</Container>
I think, I have the answer for my own question.
Import all components from 'native-base-theme/components/' instead of variables.
The code will be like this
import getTheme from './native-base-theme/components';
and add <StyleProvider>, then add prop style <StyleProvider style={getTheme()}>.
There are many ways of doing this. One way would be to follow the instructions given here. Alternatively, you can change the button theme file and add a similar style property like success shown here.
I hope this will help you,
You must be using NativeBase2
<StyleProvider style={getTheme(commonColor)}>
<Header>
<Left>
<Button transparent>
<Icon name="arrow-back" onPress={() => this.props.routerActions.pop()} />
</Button>
</Left>
<Body>
<Title>Profile</Title>
</Body>
<Right></Right>
</Header>
</StyleProvider>
For ejecting theme,
Just open this link and follow
http://nativebase.io/docs/v2.0.0/customize#themingNativeBaseApp
Now If you want to customise just look for
native-base-theme/components/Header.js
native-base-theme/variables/commonColor.js