malte-wessel / react-textfit

React component to fit headlines and paragraphs into elements
http://malte-wessel.github.io/react-textfit/
MIT License
470 stars 143 forks source link

resizing doesn't work in my app #5

Closed khan789 closed 7 years ago

khan789 commented 8 years ago

Hi the TextFit is not at all resizing the font. I'm using react v ^0.14.7; I'm using the Textfit to resize the react-datagrid column heading.

` render() { var categoryHeadings = GenerateCategoryHeadingsFromReportColumns(this.props.reportColumns);

    return (
        <div className='react-datagrid-column-category-headings'>
            <div className="category-headings-flex-box">
                {
                    _.map(categoryHeadings, function (columnHeading, key) {
                        if (columnHeading === undefined) {
                            return '';
                        }

                        var divStyle = {
                            width: columnHeading.width,
                            minWidth: columnHeading.width,
                            paddingRight: columnHeading.paddingRight
                        };
                        return (
                            <div className='category-heading' key={key} style={divStyle}>
                                <Textfit style={inlineStyle}
                                                 mode="single"
                                                 forceSingleModeWidth={false}>
                                                 {columnHeading.categoryName}
                                                   </Textfit>

                            </div>
                        );
                    })
                }
            </div>
        </div>
    );
}

`

denis-sokolov commented 7 years ago

I’m sorry, this does not seem to be a clearly described issue. Given your description, it is tricky to figure out what went wrong. Perhaps you should first try other avenues of action, such as investigate the problem further, ask for help on support forums. You could also try to come up with a simpler way to reproduce your problem on a website like jsfiddle.net. If you have new findings, by all means, feel free to add them here and the issue might be reopened.