0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-25 16:12:37 +00:00

"Added onKeyPress event handler to zoom input and page number input to blur the target on Enter key press."

This commit is contained in:
Víctor Losada Hernández
2024-05-31 19:46:40 +02:00
parent 69db1e2cb7
commit f23c0bccbc

View File

@@ -90,6 +90,11 @@ const ToolBar = ({ updateZoom, currentPage, onPageChange, totalPages }) => {
updateZoom(newZoomLevel);
}
}}
onKeyPress={(e) => {
if (e.key === 'Enter') {
e.target.blur();
}
}}
/>
<span>%</span>
</div>
@@ -128,6 +133,11 @@ const ToolBar = ({ updateZoom, currentPage, onPageChange, totalPages }) => {
parseInt(pageNumberInput) === state.currentPage + 1 ||
onPageChange(parseInt(pageNumberInput) - 1);
}}
onKeyPress={(e) => {
if (e.key === 'Enter') {
e.target.blur();
}
}}
/>
<div className="tool">