Skip to content

Commit

Permalink
fix space highlight thing
Browse files Browse the repository at this point in the history
  • Loading branch information
colinmorris committed Mar 2, 2017
1 parent c602365 commit 2c75089
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions src/LyricsPane.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ class LyricsPane extends Component {

renderLine = (line, idx) => {
var words = line.map(this.renderWord);
return <div key={idx}>{words}</div>;
var x = [];
// Hack to put spaces between word spans. We could just put them in the spans
// themselves, but then we get funny underlining behaviour.
for (let word of words) {
x.push(word);
x.push(" ");
}
return <div key={idx}>{x.slice(0,-1)}</div>;
}

onTextEdit = () => {
Expand Down Expand Up @@ -124,7 +131,8 @@ class LyricsPane extends Component {
var lines = this.props.verse.lines.map(this.renderLine);
filling = (
<div className="words lyrics"
onClick={this.props.verse && this.props.verse.isCustom() && this.startEditing} >
onClick={this.props.verse && this.props.verse.isCustom() && this.startEditing}
>
{this.props.loading &&
<h3>Loading...</h3>
}
Expand Down
2 changes: 1 addition & 1 deletion src/Word.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Word extends Component {
var kls = "word" + (this.props.focus ? " "+this.props.focus : "");
return (<span className={kls} onMouseEnter={this.onEnter}
onMouseLeave={this.onLeave}>
{this.props.raw}{" "}
{this.props.raw}
</span>);
}

Expand Down

0 comments on commit 2c75089

Please sign in to comment.