wix / react-native-ui-lib

UI Components Library for React Native
https://wix.github.io/react-native-ui-lib/
MIT License
6.59k stars 717 forks source link

button border width grow outside the container #3221

Closed adids1221 closed 3 months ago

adids1221 commented 3 months ago

Description

Button borderWidth grow outside the container fix for outline button. In outline mode, the padding isn't negative anymore so the border doesn't fill the button container inside part.

Snippet to reproduce:

import React, {Component} from 'react';
import {View, Colors, Stepper, Button} from 'react-native-ui-lib';

export default class PlaygroundScreen extends Component {
  state = {outlineWidth: 1};
  render() {
    const {outlineWidth} = this.state;
    return (
      <View bg-grey80 flex padding-20 center gap-s3>
        <Button label="Button" outline onPress={() => {}} outlineWidth={outlineWidth}/>
        <Button label="Button" outline round onPress={() => {}} outlineWidth={outlineWidth}/>
        <Button label="Button" onPress={() => {}} outlineWidth={outlineWidth} outlineColor={Colors.red30}/>
        <Button label="Button" round onPress={() => {}} outlineWidth={outlineWidth} outlineColor={Colors.red30}/>

        <Stepper
          value={outlineWidth}
          minValue={0}
          maxValue={10}
          step={1}
          onValueChange={value => this.setState({outlineWidth: value})}
        />
      </View>
    );
  }
}

Changelog

Button borderWidth grow outside the container fix for outline button.

Additional info

MADS-4436

M-i-k-e-l commented 3 months ago

I don't think I understand the bug, lets talk about it. BTW, sending outlineWidth={0} gives a border in your code (not in master)

adids1221 commented 3 months ago

I don't think I understand the bug, lets talk about it. BTW, sending outlineWidth={0} gives a border in your code (not in master)

Iv'e merged master, so outlineWidth={0} should work. Let's huddle about it.