Skip to content

Commit

Permalink
Merge pull request #142 from xsnippet/fix-tag-bar
Browse files Browse the repository at this point in the history
[Tags] Fix NewSnippet header tags input
  • Loading branch information
lotrien authored Jan 9, 2021
2 parents f5a60e4 + b796ea4 commit bbe10c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/components/NewSnippet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ const NewSnippet = ({ fetchSyntaxes, postSnippet, history, syntaxes }) => {
fetchSyntaxes()
}, [])

useEffect(() => {
recalcLangHeaderHeight()
}, [tags])

function validate() {
return validateSnippet({ content: content.trim() })
}
Expand All @@ -49,13 +45,6 @@ const NewSnippet = ({ fetchSyntaxes, postSnippet, history, syntaxes }) => {
postSnippet({ content, title, tags: tags.map(tag => tag.text), syntax, cb: json => history.push(`/${json.id}`) })
}

const recalcLangHeaderHeight = () => {
const height = snippetHeader.current.offsetHeight

document.getElementsByClassName('new-snippet-lang-header')[0]
.setAttribute('style', `height:${height}px`)
}

const onTagBlur = tag => onTagAdded({ id: tag, text: tag })

const onTagAdded = tag => {
Expand Down
2 changes: 2 additions & 0 deletions src/styles/common/overwrite.styl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
width: 47%
padding: 3px 5px 0
min-height: 29px
height: 29px
overflow: scroll
border-radius: 3px
background-color: snippet-header-normal
&__tag
Expand Down

0 comments on commit bbe10c5

Please sign in to comment.