Skip to content

Commit fef3207

Browse files
committed
fix: refactor click method to check option tag earlier in flow
1 parent 37da2a0 commit fef3207

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pydoll/element.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,14 @@ async def click_using_js(self):
257257
)
258258

259259
async def click(self, x_offset: int = 0, y_offset: int = 0):
260+
if self._is_option_tag():
261+
return await self.click_option_tag()
262+
260263
if not await self._is_element_visible():
261264
raise exceptions.ElementNotVisible(
262265
'Element is not visible on the page.'
263266
)
264267

265-
if self._is_option_tag():
266-
return await self.click_option_tag()
267-
268268
await self.scroll_into_view()
269269

270270
try:

0 commit comments

Comments
 (0)