Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

text-area-click-fix #125

Merged
merged 3 commits into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/resizable-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "resizable-core",
"version": "6.0.13",
"version": "6.0.14",
"description": "A straightforward library that enables dynamic resizing of layouts and saves the layout configurations.",
"module": "./lib/esm/index.esm.js",
"main": "./lib/cjs/index.cjs.js",
Expand Down
1 change: 0 additions & 1 deletion packages/resizable-core/src/utils/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export const getResizableEventFromMouse = (e: any, vertical: boolean): IResizabl
}

export const getResizableEvent = (e: any, vertical: boolean, previousTouchEvent: any): IResizableEvent => {
e.preventDefault()
return isTouchEvent(e)
? getResizableEventFromTouch(e, vertical, previousTouchEvent)
: getResizableEventFromMouse(e, vertical)
Expand Down
2 changes: 1 addition & 1 deletion packages/resizable-panes-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "resizable-panes-js",
"version": "6.0.25",
"version": "6.0.26",
"description": "A straightforward library that enables dynamic resizing of layouts and saves the layout configurations.",
"module": "./lib/esm/index.esm.js",
"main": "./lib/cjs/index.cjs.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/resizable-panes-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "resizable-panes-next",
"version": "6.0.27",
"version": "6.0.28",
"description": "A straightforward library that enables dynamic resizing of layouts and saves the layout configurations.",
"module": "./lib/esm/index.esm.js",
"main": "./lib/cjs/index.cjs.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export const maxSizeClassTest = 'maxSizeClassTest'

const loadingId = 'loading'
const loadedId = 'loaded'

const textAreaP1 = 'textArea-P1'
export {
containerId,
loadingId,
Expand All @@ -31,5 +33,6 @@ export {
rScontainerId,
R0, R1, R2, R3, R4, R5,
CK0, CK1, CK2, CK3, CK4, CK5, CK6,
P0, P1, P2, P3, P4, P5, P6
P0, P1, P2, P3, P4, P5, P6,
textAreaP1
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
noMinMax5PanesSet,
withMinMaxWithMinMaxUnitPixel5PanesSet
} from '../pane-model-config-sets'
import {CK0, L0, LG0, R0, R1, rScontainerId} from '../fix-test-ids'
import {CK0, L0, LG0, R0, R1, rScontainerId, textAreaP1} from '../fix-test-ids'
import {CustomResizerFirst} from '../../components/custom-resizer'
import {ResizableComponentCustomPanesTestWrapper}
from '../../components/rp-test-wrapper/resizable-component-custom-panes-test-wrapper'
Expand Down Expand Up @@ -220,4 +220,36 @@ describe('Test Pane Model', () => {
})
})
})

describe('Text area editing', () => {
it('should call api method getMap', () => {
cy.viewport(1000, 1000)
cy.mount(
<ResizableComponentCustomPanesTestWrapper
resizer={<CustomResizerFirst horizontal={false} size={10} />}
resizerSize={10}
storageApi={localStorage}
uniqueId={rScontainerId}
unmountOnHide={false}
vertical
>
<Pane
className="bg-orange-500" id="P0" size={1}
unmountOnHide={true}
>

<textarea className='w-100p h-100p' data-cy={textAreaP1} />
</Pane>
<Pane className="bg-teal-500" id="P1" size={1}>

<PaneChild hook='P1' />
</Pane>
</ResizableComponentCustomPanesTestWrapper>
)
cy.wait(50)
rCy.cyGet(textAreaP1)
.type('text test')
.should('have.value', 'text test')
})
})
})
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import {SinonSpy} from 'cypress/types/sinon'
import {getResizableEvent} from '../../../../resizable-core'

describe('Dom utils', () => {
describe('It should test getResizableEvent for Touch evevts', () => {
let preventDefault: SinonSpy
const event = {
type: 'touch',
preventDefault,
targetTouches: [{
clientX: 10,
pageX: 10,
Expand All @@ -16,8 +13,7 @@ describe('Dom utils', () => {
}

beforeEach(() => {
preventDefault = cy.spy()
event.preventDefault = preventDefault

})

afterEach(() => {
Expand All @@ -26,18 +22,13 @@ describe('Dom utils', () => {

it('should test getResizableEvent vertical panes ', () => {
const retValue = [10, 10]

const value = getResizableEvent(event, true, {})
expect(preventDefault.calledOnce).to.equal(true)

expect(value).to.deep.equals(retValue)
})

it('should test getResizableEvent Horizontal panes ', () => {
const retValue = [20, 20]
const value = getResizableEvent(event, false, {})
expect(preventDefault.calledOnce).to.equal(true)

expect(value).to.deep.equals(retValue)
})
})
Expand Down
2 changes: 1 addition & 1 deletion packages/resizable-panes-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "resizable-panes-react",
"version": "6.0.25",
"version": "6.0.26",
"description": "A straightforward library that enables dynamic resizing of layouts and saves the layout configurations.",
"module": "./lib/esm/index.esm.js",
"main": "./lib/cjs/index.cjs.js",
Expand Down
Loading