Skip to content

Commit bbe10c5

Browse files
authored
Merge pull request #142 from xsnippet/fix-tag-bar
[Tags] Fix NewSnippet header tags input
2 parents f5a60e4 + b796ea4 commit bbe10c5

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

src/components/NewSnippet.jsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ const NewSnippet = ({ fetchSyntaxes, postSnippet, history, syntaxes }) => {
3737
fetchSyntaxes()
3838
}, [])
3939

40-
useEffect(() => {
41-
recalcLangHeaderHeight()
42-
}, [tags])
43-
4440
function validate() {
4541
return validateSnippet({ content: content.trim() })
4642
}
@@ -49,13 +45,6 @@ const NewSnippet = ({ fetchSyntaxes, postSnippet, history, syntaxes }) => {
4945
postSnippet({ content, title, tags: tags.map(tag => tag.text), syntax, cb: json => history.push(`/${json.id}`) })
5046
}
5147

52-
const recalcLangHeaderHeight = () => {
53-
const height = snippetHeader.current.offsetHeight
54-
55-
document.getElementsByClassName('new-snippet-lang-header')[0]
56-
.setAttribute('style', `height:${height}px`)
57-
}
58-
5948
const onTagBlur = tag => onTagAdded({ id: tag, text: tag })
6049

6150
const onTagAdded = tag => {

src/styles/common/overwrite.styl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
width: 47%
2626
padding: 3px 5px 0
2727
min-height: 29px
28+
height: 29px
29+
overflow: scroll
2830
border-radius: 3px
2931
background-color: snippet-header-normal
3032
&__tag

0 commit comments

Comments
 (0)