mirror of
https://github.com/uetchy/namae.git
synced 2025-03-17 04:30:31 +09:00
fix: sanitize input
This commit is contained in:
parent
9964b4a6da
commit
f4b6140aa6
@ -34,7 +34,8 @@ export default function App() {
|
||||
const queryGiven = query && query.length > 0
|
||||
|
||||
useEffect(() => {
|
||||
setQuery(inputValue)
|
||||
const modifiedValue = inputValue.replace(/[\s@\+!#$%^&*()\[\]]/g, '')
|
||||
setQuery(modifiedValue)
|
||||
}, [inputValue, setQuery])
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -16,6 +16,8 @@ export default function Suggestion({ query, onSubmit }) {
|
||||
`${capital}Lab`,
|
||||
`${capital}Kit`,
|
||||
`Open${capital}`,
|
||||
`${capital}box`,
|
||||
`${lower}hub`,
|
||||
]
|
||||
.sort(() => Math.random() - 0.5)
|
||||
.slice(0, 3)
|
||||
|
Loading…
x
Reference in New Issue
Block a user